예제 #1
0
 internal static BattleResult <CARD_VALUE> Battle(CARD_VALUE v1, CARD_VALUE v2)
 {
     if (v1.Equals(v2))
     {
         return(BattleResult <CARD_VALUE> .CreateEquality());
     }
     return(BattleResult <CARD_VALUE> .CreateWinner((CARD_VALUE)Math.Max((int)v1, (int)v2)));
 }
예제 #2
0
        public void Should_player_one_win_versus_player_two()
        {
            GameWar game = new GameWar();

            Player     p1 = new Player();
            CARD_VALUE v1 = CARD_VALUE.ACE;

            p1.PlaceCard(game, v1);

            CARD_VALUE v2 = CARD_VALUE.TWO;
            Player     p2 = new Player();

            p2.PlaceCard(game, v2);

            Assert.AreEqual(p1, game.ResolveRound());
        }
예제 #3
0
 internal void Play(Player player, CARD_VALUE v1)
 {
     currentRound[player] = v1;
 }
예제 #4
0
 internal void PlaceCard(CARD_VALUE v1, Player player)
 {
     currentRound.Play(player, v1);
 }
예제 #5
0
 internal void PlaceCard(GameWar game, CARD_VALUE v1)
 {
     game.PlaceCard(v1, this);
 }