예제 #1
0
        public void CreatureTestInitialize()
        {
            _layout = new Layout(1, "Layout 1", 100, 100);
            for (var i = 50; i <= 100; i++)
            {
                for (var j = 1; j <= 100; j++)
                {
                    _layout.addTerritory(i, j);
                }
            }
            _context = new SimulationContext(_layout);

            _species = new Species("Dog", 15, 4, Digestion.Carnivore, 20, 60, 10, 100, 0, 95, 20);

            _creature1 = new Creature(51, 56, _context, 70, 80, _species, Direction.N);
            _creature2 = new Creature(70, 82, _context, 70, 80, _species, Direction.E);
            _creature3 = new Creature(83, 85, _context, 70, 80, _species, Direction.S);
            _context.AddCreature(_creature1);
            _context.AddCreature(_creature2);
            _context.AddCreature(_creature3);
            _context.AddPlant(50, 51, 56);
            _context.AddPlant(60, 84, 63);
            _context.AddObstacle(84, 64);
            _context.AddObstacle(100, 100);
            _context.AddObstacle(83, 86);
        }
예제 #2
0
 public void AddObstacleTest()
 {
     _context.AddObstacle(new Obstacle(50, 52, _context));
     Assert.IsTrue(_context.GetAllSimObjects().Any(c => c.YPos == 52 && c.XPos == 50));
 }