public void PlayCardOnStack(Player player, Card card, OpenStackOfCards stack) { if (stack.CanAddCard(card)) { stack.AddCard(player.PlayOpenCard(card)); } }
private void Initialize() { Deck = StackOfCards.CreateFullDeckOfCards(); Deck.Shuffle(); LeftStack = new OpenStackOfCards(); RightStack = new OpenStackOfCards(); PlayerOne = null; PlayerTwo = null; }
/// <summary> /// Restarts the game with the same players /// </summary> public void RestartGame() { Deck = StackOfCards.CreateFullDeckOfCards(); Deck.Shuffle(); LeftStack = new OpenStackOfCards(); RightStack = new OpenStackOfCards(); // todo: ugly var playerOneName = PlayerOne.NickName; var playerTwoName = PlayerTwo.NickName; PlayerOne = null; PlayerTwo = null; AddPlayer(playerOneName); AddPlayer(playerTwoName); }