Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
        // рекомендуется этот метод
        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);
                    }
                }
            }
        }
Beispiel #4
0
 public void Send(AbstractInfrastucture to, Material mat)
 {
     throw new NotImplementedException("Use Send(Material) method instead this");
 }
Beispiel #5
0
 public void SetNeighbor(GameCell c, AbstractInfrastucture infra)
 {
     neighbors[c] = infra;
 }