public virtual void CardPicked(CommandCard card) { draftCards.Remove(card); GameMaster.Instance.currentPlayer.hand.Add(card); SetCurrentCard(card); GameMaster.Instance.currentPlayer.ready = true; }
private bool SlotCommandCard(int index, CommandCard card) { // If there are already cards in the stack if (cards[index].Count > 0) { if (!(cards[index].PeekTop() is CommandCard)) { return(false); } CommandCard oldTopCard = cards[index].PeekTop() as CommandCard; // If card is same color, add new one to the stack. if (oldTopCard.cardColor == card.cardColor) { // If stack is full remove bottom card from stack. if (cards[index].Count == 3) { GameMaster.Instance.commandCardDeck.DiscardCard(cards[index].PopBottom() as CommandCard); } card.level = Mathf.Min(3, oldTopCard.level + 1); } // If card is different color, discard old stack. else { int stackSize = cards[index].Count; for (int i = 0; i < stackSize; i++) { GameMaster.Instance.commandCardDeck.DiscardCard(cards[index].PopTop() as CommandCard); } } } cards[index].AddTop(card); return(true); }
public void SetCurrentCard(CommandCard card) { GameMaster.Instance.currentPlayer.currentCard = card; }