public void Build(int i, int j, AbstractInfrastucture infra) { if (gameMap[i, j].infra == null) { gameMap[i, j].infra = infra; playerData[playerCompanyName].infraList.Add(infra); } }
public GameCell(int x, int y, AbstractInfrastucture infra, bool land, Ore ore) { this.x = x; this.y = y; this.infra = infra; this.land = land; this.ore = ore; }
// рекомендуется этот метод public void Build(string company, PointF p, AbstractInfrastucture infra) { if (IsInBounds(p)) { var c = gameMap[(int)p.Y, (int)p.X]; Build((int)p.Y, (int)p.X, infra); infra.OnBuild(c, playerData[company]); foreach (var np in GetNeighborPoints(p)) { var nCell = gameMap[(int)np.Y, (int)np.X]; infra.SetNeighbor(nCell, nCell.infra); if (gameMap[(int)np.Y, (int)np.X].infra != null) { gameMap[(int)np.Y, (int)np.X].infra.SetNeighbor(infra.bottomLeftPosition, infra); } } } }
public void Send(AbstractInfrastucture to, Material mat) { throw new NotImplementedException("Use Send(Material) method instead this"); }
public void SetNeighbor(GameCell c, AbstractInfrastucture infra) { neighbors[c] = infra; }