예제 #1
0
        private static void CheckAttackLogic()
        {
            Random rng = new Random();

            IPiece attacker = new Piece((Rank)rng.Next(0, 14), 1);
            IPiece attacked = new Piece((Rank)rng.Next(0, 14), 2);

            Console.WriteLine($"{attacker.Rank} is attacking {attacked.Rank}");

            IArbiter arbiter = new Arbiter();
            var      result  = arbiter.DecideWinner(attacker, attacked);

            if (result.IsDraw)
            {
                Console.WriteLine("Result is Draw");
            }
            else
            {
                Console.WriteLine($"The winner is {result.Winner}");
            }
        }