Пример #1
0
 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;
 }
Пример #2
0
        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));
        }
Пример #3
0
        private static string RenderPoint(bool isComplete, Card card)
        {
            if (card == null)
                return "?";
            if (!isComplete)
                return "-";

            return card.Points.ToString();
        }
Пример #4
0
 public void Play(Card card)
 {
     _cards[card.Player] = card;
     CheckForConsensus();
 }