Ejemplo n.º 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;
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
        private static string RenderPoint(bool isComplete, Card card)
        {
            if (card == null)
                return "?";
            if (!isComplete)
                return "-";

            return card.Points.ToString();
        }
Ejemplo n.º 4
0
 public void Play(Card card)
 {
     _cards[card.Player] = card;
     CheckForConsensus();
 }