Esempio n. 1
0
    public void UpdateHandText(PokerHands.Hands handValue)
    {
        //Debug.Log("Hand value is " + handValue);
        switch (handValue)
        {
        case PokerHands.Hands.ROYALFLUSH:
            handText.text    = "ROYAL FLUSH";
            handText.enabled = true;
            break;

        case PokerHands.Hands.STRAIGHTFLUSH:
            handText.text    = "STRAIGHT FLUSH";
            handText.enabled = true;
            break;

        case PokerHands.Hands.FOUROFAKIND:
            handText.text    = "FOUR OF A KIND";
            handText.enabled = true;
            break;

        case PokerHands.Hands.FULLHOUSE:
            handText.text    = "FULL HOUSE";
            handText.enabled = true;
            break;

        case PokerHands.Hands.FLUSH:
            handText.text    = "FLUSH";
            handText.enabled = true;
            break;

        case PokerHands.Hands.STRAIGHT:
            handText.text    = "STRAIGHT";
            handText.enabled = true;
            break;

        case PokerHands.Hands.THREEOFAKIND:
            handText.text    = "THREE OF A KIND";
            handText.enabled = true;
            break;

        case PokerHands.Hands.TWOPAIR:
            handText.text    = "TWO PAIR";
            handText.enabled = true;
            break;

        case PokerHands.Hands.JACKSORBETTER:
            handText.text    = "JACKS OR BETTER";
            handText.enabled = true;
            break;

        default:
            handText.text    = "";
            handText.enabled = false;
            break;
        }
    }
Esempio n. 2
0
    private void OnGamePayout()
    {
        // TODO: rewarding even without win???

        int originalValue = Credits;

        PokerHands.Hands pHand = ObjectReferences.playerHand.handValue;
        if (pHand != PokerHands.Hands.NOTHING)
        {
            if (pHand == PokerHands.Hands.ROYALFLUSH && CurrentBet == 5)
            {
                Credits += 4000;
            }
            else
            {
                //Debug.Log(pHand + " * " + CurrentBet);
                Credits += PokerHands.handMultipliers[(int)pHand] * CurrentBet;
            }
        }
        EventManager.Animation.OnStartAnimatePayout?.Invoke(originalValue, Credits);
    }
Esempio n. 3
0
 private void CalculateHandAndUpdateUI(bool isFirstDeal)
 {
     handValue = PokerHands.CalculateHandValue(currentHand);
     StartCoroutine(UpdateCardsAtEndOfFrame(isFirstDeal));
 }