/* * @see betting_center.IBettingCenter_Manager#honourTheBets(int, java.util.TreeMap) */ @Override public void honourTheBets(int numWinnerHorses, TreeMap<Integer, Bet> winnerSpectators) { lock.lock(); fileLogger.log( CLASS_TAG, "honourTheBets", FunctionState.START, "numWinnerHorses:" + numWinnerHorses + " winnerSpectators:" + winnerSpectators); while (winnerSpectators.size() != 0) { betManagerIsHonouringBets = true; betManagerIsHonouringBetsCondition.signal(); while (!spectatorCollectingGain) waitForCondition(spectatorCollectingGainConditon); spectatorCollectingGain = false; Bet bet = winnerSpectators.remove(spectatorToHonourBetID); // TODO: Multiply with horse odd value */ honourBet = bet.getHorseWinOdd() * bet.getBetValue(); betManagerHasHonourBet = true; betManagerHasHonourBetCondition.signal(); fileLogger.log( CLASS_TAG, "honourTheBets", FunctionState.MIDDLE, " winnerSpectators:" + winnerSpectators); } fileLogger.log( CLASS_TAG, "honourTheBets", FunctionState.END, "numWinnerHorses:" + numWinnerHorses + " winnerSpectators:" + winnerSpectators); lock.unlock(); }