public static Game Play(Game game, string playerName, int points) { if (game == null) game = new Game(); var rumples = new Player { Name = playerName }; game.AddPlayer(rumples); var card = new Card { Player = rumples, Points = points }; game.Play(card); return game; }
public void PlayerCanPlayACard() { var game = new Game(); var player = new Player {Name = "Rumples"}; game.AddPlayer(player); var card = new Card {Player = player, Points = 0}; game.Play(card); var cards = game.GetCards(); var result = cards.First(); Assert.That(result.Player.Name, Is.EqualTo(player.Name)); Assert.That(result.Points, Is.EqualTo(card.Points)); }
private static string RenderPoint(bool isComplete, Card card) { if (card == null) return "?"; if (!isComplete) return "-"; return card.Points.ToString(); }
public void Play(Card card) { _cards[card.Player] = card; CheckForConsensus(); }