protected AbstractInfrastucture(string name, InfraType type, Sprite sprite, int amount, string buildCommand) { this.name = name; this.type = type; this.sprite = sprite; this.buildCommand = buildCommand; this.amount = amount; this.neighbors = new Dictionary <GameCell, AbstractInfrastucture>(); this.rawMaterials = new List <Material>(); this.gameCells = new List <GameCell>(); this.bottomLeftPosition = null; this.owner = null; this.level = 1; this.locker = new object(); }
public void GenMap() { for (var i = 0; i < groundLevel; i++) { for (var j = 0; j < Width; j++) { gameMap[i, j] = new GameCell(j, i, null, false); } } for (var i = groundLevel; i < Height; i++) { for (var j = 0; j < Width; j++) { gameMap[i, j] = new GameCell(j, i, null, true); } } for (var i = 300; i < 310; i++) { for (var j = groundLevel - 3; j < groundLevel; j++) { Build(playerCompanyName, new PointF(i, j), Prefabs.StorageInfra); } } for (var i = 280; i < 290; i++) { for (var j = groundLevel + 10; j < groundLevel + 13; j++) { gameMap[j, i].ore = Prefabs.IronOre; } } for (var i = 315; i < 319; i++) { for (var j = groundLevel + 5; j < groundLevel + 7; j++) { gameMap[j, i].ore = Prefabs.CoalOre; } } }
public void SetNeighbor(GameCell c, AbstractInfrastucture infra) { neighbors[c] = infra; }
public void OnBuild(GameCell pos, PlayerData owner) { this.bottomLeftPosition = pos; this.owner = owner; }