public void Deal(Participant participant) { if (State == GameState.Playing) { Card card = Instantiate(cardPrefab, participant.Container).GetComponent <Card>(); card.Set(CardDeck.DrawCard()); card.transform.position = DeckTransform.position; participant.AddCard(card); } }
public void AddCard(Participant participant, uint amount) { for (int i = 0; i < amount; i++) { if (availableCards.Count == 0) { Shuffle(); } if (availableCards.Count != 0) { int cardIndex = Random.Range(0, availableCards.Count); participant.AddCard(availableCards[cardIndex]); availableCards.RemoveAt(cardIndex); } else { Debug.LogWarning("There is no more card!"); } } }