/// <summary> /// Message handler used to highlight the awarded value on the top screen. /// </summary> /// <param name="betAmountIndex"></param> /// <param name="payType"></param> /// <returns></returns> private void HandleHighlightAwardedValue(int betAmountIndex, StandardCardDeck.DeckConstants.PokerHandType payType) { highlightedAwardIndex = GameUtils.Constants.INVALID_AWARD_INDEX; if (enumToArrayIndexMap.TryGetValue(payType, out highlightedAwardIndex)) { initialFontColor = winNameTextMeshes[highlightedAwardIndex].color; winNameTextMeshes[highlightedAwardIndex].color = winHighlightColor; } }
/// <summary> /// Handles the report win message. /// </summary> /// <param name="winAmountBaseCredits"></param> /// <returns></returns> private void HandleReportWinMessage(StandardCardDeck.DeckConstants.PokerHandType winType) { double winAmountBaseCredits = currentPaytableList.Paytables[currentBetIndex].GetCreditWinAmount(winType); playersWalletAmountInDollars += (winAmountBaseCredits * currentDenom); Messenger.Broadcast <double>(GameEvents.Bet.UpdatePaidCredits, winAmountBaseCredits); Messenger.Broadcast <double, double>(GameEvents.Bet.UpdateCredits, ConvertMoneyToCredits(playersWalletAmountInDollars, currentDenom), currentDenom); Messenger.Broadcast <int, StandardCardDeck.DeckConstants.PokerHandType>(GameEvents.Award.HighlightAwardedValue, currentBetIndex + 1, winType); }
/// <summary> /// Utility function used to get the base amount won based off the hand. /// </summary> /// <param name="handType"></param> /// <returns></returns> public double GetCreditWinAmount(StandardCardDeck.DeckConstants.PokerHandType handType) { for (int i = 0; i < paytableAwards.Count; ++i) { if (paytableAwards[i].PayType == handType) { return(paytableAwards[i].BaseValue); } } return(0.0); }
/// <summary> /// Message handler used to reset the highlight awarded value on the top screen. /// </summary> /// <returns></returns> private void HandleHighlightAwardedValue(int betAmountIndex, StandardCardDeck.DeckConstants.PokerHandType payType) { // If this message is not for us, return. if (betAmountIndex != betAmountFilter) { return; } highlightedAwardIndex = GameUtils.Constants.INVALID_AWARD_INDEX; if (enumToArrayIndexMap.TryGetValue(payType, out highlightedAwardIndex)) { initialFontColor = listOfTextElementsToPopulate[highlightedAwardIndex].color; listOfTextElementsToPopulate[highlightedAwardIndex].color = winHighlightColor; } }