예제 #1
0
 public void PrintHand()
 {
     foreach (GameObject g in hand)
     {
         cardScript script = g.GetComponent <cardScript>();
         Debug.Log(script.GetFace() + " of " + script.GetSuit() + "(" + script.GetValue() + ")");
     }
 }
예제 #2
0
    //After insurance is taken or not, the dealer flips his second card if it's a 10.
    //If not, the hand continues as normal, the player's money wasted if they
    //took insurance that turn.
    public void Insurance(bool tookInsurance)
    {
        player.SetInsurance(tookInsurance);
        cardScript script = hand[1].GetComponent <cardScript>();

        if (script.GetValue() == 10 || player.GetHandValue() == 21)
        {
            UI.SetHitAndStand(false);
            UI.SetDoubleDown(false);
            StartCoroutine(Blackjack());
        }
        else
        {
            UI.SetHitAndStand(true);
            if (UI.GetFunds() > player.GetBetAmount())
            {
                UI.SetDoubleDown(true);
            }
        }
    }