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)); }
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); }
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(); }
public void AddFood(int row, int col) { Map[row, col] = Tile.Food; FoodTiles.Add(new Location(row, col)); }
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; }
public FoodViewResolver(IEventSystem eventSystem, IEntityCollectionManager collectionManager, IUnityInstantiator instantiator, FoodTiles foodTiles) : base(eventSystem, collectionManager, instantiator) { _foodTiles = foodTiles; }