Пример #1
0
 public void CreateAll()
 {
     Level   = LevelCreator.OfSize(null, new Size(2, 1));
     Entity  = new TestEntity(0, 0);
     Entity1 = new TestEntity(1, 0);
     Level.PlaceObject(Entity);
     Level.PlaceObject(Entity1);
     Entity.Rotate(Direction.Right);
 }
Пример #2
0
        public void Test_AttackSteps()
        {
            var entity1 = new TestEntity(0, 1);

            Level.PlaceObject(entity1);
            var initialHealth = entity1.Health;

            Entity.Scheduler.AddAttack(Entity, Entity.Position);
            Entity.Scheduler.Commit();
            Assert.IsTrue(entity1.Health < initialHealth);
        }
Пример #3
0
        public void Test_CorrectlyAttacks()
        {
            var enemy1        = new TestEntity(1, 0);
            var initialHealth = enemy1.Health;

            level.PlaceObject(enemy1);
            ai.TryScheduleAttack(level, testEnemy, new[] { enemy1.Position });
            while (testEnemy.Scheduler.Commit())
            {
                ;
            }
            Assert.IsTrue(enemy1.Health < initialHealth);
        }
Пример #4
0
 public void CreateAll()
 {
     Entity = new TestEntity(0, 0);
     Entity.SetAttack(new Attack(new[] { new Size(1, 0) }, AttackType.Fire, 10, 1, true));
     Level = LevelCreator.OfSize(null, new Size(3, 3));
     Level.PlaceObject(Entity);
 }
Пример #5
0
 public void SetUp()
 {
     game      = new GameModel(levelLines);
     level     = game.CurrentLevel;
     testEnemy = new TestEnemy(game, new Point(1, 1));
     level.PlaceObject(testEnemy);
     ai = new BasicAI(game, new List <BasicEnemy> {
         testEnemy
     });
 }