Пример #1
0
 public void RemoveFood(int row, int col)
 {
     // an ant could move into a spot where a food just was
     // don't overwrite the space unless it is food
     if (Map[row, col] == Tile.Food)
     {
         Map[row, col] = Tile.Land;
     }
     FoodTiles.Remove(new Location(row, col));
 }
Пример #2
0
        public void StartNewTurn()
        {
            // start timer
            turnStart = DateTime.Now;

            // clear ant data
            foreach (Location loc in MyAnts)
            {
                map[loc.Row, loc.Col] = Tile.Land;
            }
            foreach (Location loc in MyHills)
            {
                map[loc.Row, loc.Col] = Tile.Land;
            }
            foreach (Location loc in EnemyAnts)
            {
                map[loc.Row, loc.Col] = Tile.Land;
            }
            foreach (Location loc in EnemyHills)
            {
                map[loc.Row, loc.Col] = Tile.Land;
            }
            foreach (Location loc in DeadTiles)
            {
                map[loc.Row, loc.Col] = Tile.Land;
            }

            MyHills.Clear();
            MyAnts.Clear();
            EnemyHills.Clear();
            EnemyAnts.Clear();
            DeadTiles.Clear();

            // set all known food to unseen
            foreach (Location loc in FoodTiles)
            {
                map[loc.Row, loc.Col] = Tile.Land;
            }
            FoodTiles.Clear();
            OccupiedNextRound.Init(false);
        }
Пример #3
0
        public void StartNewTurn()
        {
            // start timer
            turnStart = DateTime.Now;

            // clear ant data
            foreach (Location loc in MyAnts)
            {
                Map[loc.RowY, loc.ColX] = Tile.Land;
            }
            foreach (Location loc in MyHills)
            {
                Map[loc.RowY, loc.ColX] = Tile.Land;
            }
            foreach (Location loc in EnemyAnts)
            {
                Map[loc.RowY, loc.ColX] = Tile.Land;
            }
            //foreach (Location loc in EnemyHills) Map[loc.RowY, loc.ColX] = Tile.Land;
            foreach (Location loc in DeadTiles)
            {
                Map[loc.RowY, loc.ColX] = Tile.Land;
                EnemyHills.RemoveWhere(x => x.EqualTo(loc));
            }

            MyHills.Clear();
            MyAnts.Clear();
            //EnemyHills.Clear();
            EnemyAnts.Clear();
            DeadTiles.Clear();

            // set all known food to unseen
            foreach (Location loc in FoodTiles)
            {
                Map[loc.RowY, loc.ColX] = Tile.Land;
            }
            FoodTiles.Clear();
        }
Пример #4
0
 public void AddFood(int row, int col)
 {
     Map[row, col] = Tile.Food;
     FoodTiles.Add(new Location(row, col));
 }
Пример #5
0
 public FoodViewResolver(IViewHandler viewHandler, FoodTiles foodTiles) : base(viewHandler)
 {
     _foodTiles = foodTiles;
 }
 public FoodViewResolver(IEventSystem eventSystem, IEntityDatabase entityDatabase, IUnityInstantiator instantiator, FoodTiles foodTiles)
     : base(eventSystem, entityDatabase, instantiator)
 {
     _foodTiles = foodTiles;
 }
Пример #7
0
 public FoodViewResolver(IEventSystem eventSystem, IEntityCollectionManager collectionManager, IUnityInstantiator instantiator, FoodTiles foodTiles)
     : base(eventSystem, collectionManager, instantiator)
 {
     _foodTiles = foodTiles;
 }