public void HandleUse(Player player, Table table) { Console.WriteLine("[OK] Player {0} put on table a {1} card", player.Id, CardBeautifuler.GetStringCard(this)); switch (Value) { case CardValue.ChangeColor: break; case CardValue.PassTurn: table.TurnToNextPlayer(); break; case CardValue.Revert: table.Players.Reverse(); break; case CardValue.Plus2: case CardValue.Plus4: var nb = (Value == CardValue.Plus2) ? 2 : 4; var next = table.GetNextPlayer(); for (var i = 0; i != nb; ++i) { var card = table.StackCard.PopRandomCard(); next.Hand.AddCard(card); } player.HasUno = false; break; } }
public void DisplayHand() { var index = 0; foreach (var card in Cards) { Console.WriteLine(index + " : " + CardBeautifuler.GetStringCard(card)); index++; } }