示例#1
0
    // Add a hand to the player/dealer's hand
    public int GetCard()
    {
        // Get a card, use deal card to assign sprite and value to card on table
        int cardValue = deckScript.DealCard(hand[cardIndex].GetComponent <CardScript>());

        // Show card on game screen
        hand[cardIndex].GetComponent <Renderer>().enabled = true;
        handValue += cardValue;
        // if value is 1, it is an ace
        if (cardValue == 1)
        {
            aceList.Add(hand[cardIndex].GetComponent <CardScript>());
        }
        // Check if we should use an 11 instead of a 1
        // AceCheck();
        cardIndex++;
        return(handValue);
    }
示例#2
0
    public int GetCard()
    {
        int cardValue = deckScript.DealCard(hand[cardIndex].GetComponent <CardScript>());


        hand[cardIndex].GetComponent <Renderer>().enabled = true;

        handValue += cardValue;

        if (cardValue == 1)
        {
            aceList.Add(hand[cardIndex].GetComponent <CardScript>());
        }

        AceCheck();


        cardIndex++;

        return(handValue);
    }
示例#3
0
 void OnMouseDown()                                                                                                                                                          //if the deck pile is clicked on, another card is dealt
 {
     deckScript.DealCard();
 }