public void DeadAnt(int row, int col) { map[col, row].isDeadAnt = true; // but always add to the dead list DeadTiles.Add(new Location(row, col)); }
public void DeadAnt(int row, int col) { // food could spawn on a spot where an ant just died // don't overwrite the space unless it is land if (Map[row, col] == Tile.Land) { Map[row, col] = Tile.Dead; } // but always add to the dead list DeadTiles.Add(new Location(row, col)); }
public void StartNewTurn() { // start timer turnStart = DateTime.Now; foreach (var coord in coords) { ClearDynamic(ref map[coord.x, coord.y]); } MyHills.Clear(); MyAnts.Clear(); EnemyHills.Clear(); EnemyAnts.Clear(); DeadTiles.Clear(); FoodTiles.Clear(); }
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(); }