예제 #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);
     }
 }
예제 #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;
 }
예제 #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);
                    }
                }
            }
        }
예제 #4
0
 public void Send(AbstractInfrastucture to, Material mat)
 {
     throw new NotImplementedException("Use Send(Material) method instead this");
 }
예제 #5
0
 public void SetNeighbor(GameCell c, AbstractInfrastucture infra)
 {
     neighbors[c] = infra;
 }