public void CreateColony(Tile tile, int population) { var colony = new Colony(Nation, tile, population); tile.OwnedBy = colony; Colonies.Add(colony); }
private void InitializeColonies() { var colonyPosition = new Vector2f(0, 0); int intCPosX = (int)colonyPosition.X; int intCposY = (int)colonyPosition.Y; var chunkSize = Chunk <Cell> .SIZE; //Generate four chunks around colony; Smells[intCPosX, intCposY].Item = null; Smells[intCPosX - chunkSize, intCposY].Item = null; Smells[intCPosX, intCposY - chunkSize].Item = null; Smells[intCPosX - chunkSize, intCposY - chunkSize].Item = null; var queen = AntsFactory.CreateQueen(); queen.Position = colonyPosition; engine.Register(queen); var colony = new Colony(0, colonyPosition, queen); for (int i = 0; i < 100; i++) { var ant = AntsFactory.CreateWorker(); ant.Position = colonyPosition; colony.Ants.Add(ant); engine.Register(ant); } Colonies.Add(colony); }
public void AddColony(ColonyData pc) { if (CapitalColony == null) { CapitalColony = pc; } Colonies.Add(pc); }