Пример #1
0
        public static void GeneratePlayers(int count)
        {
            for (var i = 0; i < count; i++)
            {
                BasePlayer player;
                var        name   = PlayerNames[new Random().Next(0, PlayerNames.Count)];
                var        force  = new Random().Next(15, 31);
                var        health = new Random().Next(80, 101);
                switch (new Random().Next(0, 3))
                {
                case 0:
                    player = new KnightPlayer(name, force, health);
                    break;

                case 1:
                    player = new ArcherPlayer(name, force, health);
                    break;

                case 2:
                    player = new MagePlayer(name, force, health);
                    break;

                default:
                    player = null;
                    break;
                }
                PlayerLists.Add(player);
            }
        }
Пример #2
0
        public void CheckHealth(int health, bool isHealthy)
        {
            var magePlayer = new KnightPlayer("Name", 5, health);

            Assert.AreEqual(magePlayer.CheckHealth(), isHealthy);
        }
Пример #3
0
 public void Dispose()
 {
     KnightPlayer = null;
     RivalPlayer  = null;
 }
Пример #4
0
 public void Setup()
 {
     KnightPlayer = new KnightPlayer("Name", 5, 100);
     RivalPlayer  = new KnightPlayer("Name", 5, 100);
 }