Пример #1
0
 private void MoveResolvedCards(Player playerA, Player playerB)
 {
     playerA.Hand.AddCard(playerA.Hand.CardsInHand[0]);
     playerA.Hand.RemoveCard(playerA.Hand.CardsInHand[0]);
     playerA.Hand.AddCard(playerB.Hand.CardsInHand[0]);
     playerB.Hand.RemoveCard(playerB.Hand.CardsInHand[0]);
     foreach (var card in TemporaryHand.CardsInHand)
     {
         playerA.Hand.AddCard(card);
         TemporaryHand.RemoveCard(card);
     }
 }
Пример #2
0
 private void ResolveComparison(int result)
 {
     if (result == 1)
     {
         View.Print("Player1 won this round");
         MoveResolvedCards(Player1, Player2);
         ChangeActivePlayer(Player1, Player2);
     }
     if (result == -1)
     {
         View.Print("Player2 won this round");
         MoveResolvedCards(Player2, Player1);
         ChangeActivePlayer(Player2, Player1);
     }
     if (result == 0)
     {
         View.Print("It was a draw. Game continues...");
         TemporaryHand.AddCard(Player1.Hand.CardsInHand[0]);
         TemporaryHand.RemoveCard(Player1.Hand.CardsInHand[0]);
         TemporaryHand.RemoveCard(Player2.Hand.CardsInHand[0]);
         TemporaryHand.AddCard(Player1.Hand.CardsInHand[0]);
     }
 }