public void ClientState_NewDeck() { if (deck.CardCount < minNumberOfCardsInDeck) { deck.Reset(); deck.CreateDeck(6); } }
void CheckForCardCount() { if (deck.CardCount <= 1) { deck.CreateDeck(); } }
void StartGame() { GameObject playerCopy = (GameObject)Instantiate(playerPrefab); Player newPlayer = playerCopy.GetComponent<Player>(); newPlayer.SetSeatPosition(0); players.Add(newPlayer); deck.CreateDeck(6); Deal(); }
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(); }
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(); }