public void DealDisplayingCards(Player player, int numberOfCard, bool animated = true) { int start = DisplayingCards.Count - 1; int finish = DisplayingCards.Count - 1 - numberOfCard; List <Card> cardsToRemoveFromDeck = new List <Card>(); for (int i = start; i > finish; i--) { Card card = DisplayingCards[i]; player.ReceiveDisplayingCard(card); cardsToRemoveFromDeck.Add(card); if (animated) { AddCardAnimation(card, player.NextCardPosition()); } else { card.transform.position = player.NextCardPosition(); } } foreach (Card card in cardsToRemoveFromDeck) { DisplayingCards.Remove(card); } }
public void DrawDisplayingCard(Player player) { int numberOfDisplayingCard = DisplayingCards.Count; if (numberOfDisplayingCard > 0) { Card card = DisplayingCards[numberOfDisplayingCard - 1]; player.ReceiveDisplayingCard(card); AddCardAnimation(card, player.NextCardPosition()); DisplayingCards.Remove(card); } }
public void DrawDisplayingCard(Player player, byte value) { int numberOfDisplayingCard = DisplayingCards.Count; if (numberOfDisplayingCard > 0) { Card card = DisplayingCards[numberOfDisplayingCard - 1]; card.SetCardValue(value); card.SetFaceUp(true); player.ReceiveDisplayingCard(card); AddCardAnimation(card, player.NextCardPosition()); DisplayingCards.Remove(card); } }