public void ClientState_NewDeck()
 {
     if (deck.CardCount < minNumberOfCardsInDeck)
     {
         deck.Reset();
         deck.CreateDeck(6);
     }
 }
示例#2
0
 void CheckForCardCount()
 {
     if (deck.CardCount <= 1)
     {
         deck.CreateDeck();
     }
 }
示例#3
0
    void StartGame()
    {
        GameObject playerCopy = (GameObject)Instantiate(playerPrefab);
        Player newPlayer = playerCopy.GetComponent<Player>();
        newPlayer.SetSeatPosition(0);
        players.Add(newPlayer);

        deck.CreateDeck(6);
        Deal();

    }
示例#4
0
    public void PlayAgain()
    {
        playAgainButton.interactable = false;

        player.GetComponent <CardStackView>().Clear();
        dealer.GetComponent <CardStackView>().Clear();
        deck.GetComponent <CardStackView>().Clear();
        deck.CreateDeck();

        hitButton.interactable   = true;
        stickButton.interactable = true;
        dealersFirstCard         = -1;

        StartGame();
    }
示例#5
0
 void Start()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
     start     = GetComponent <RectTransform>();
     cardStack = GetComponent <CardStack>();
     cardStack.CreateDeck();
     ShowCards();
 }
    public void PlayAgain()
    {
        playAgainButton.interactable = false;

        //Remove visual component as well as data behind the scenes
        player.GetComponent <CardStackView>().Clear();
        dealer.GetComponent <CardStackView>().Clear();
        deck.GetComponent <CardStackView>().Clear();
        deck.CreateDeck();
        winnerText.text = "";

        dealersFirstCard = -1;

        hitButton.interactable   = true;
        stickButton.interactable = true;

        playerScore.text = "0";
        dealerScore.text = "?";

        StartGame();
    }