コード例 #1
0
        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();
        }
コード例 #2
0
        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;
                }
            }
        }
コード例 #3
0
 public void SetNeighbor(GameCell c, AbstractInfrastucture infra)
 {
     neighbors[c] = infra;
 }
コード例 #4
0
 public void OnBuild(GameCell pos, PlayerData owner)
 {
     this.bottomLeftPosition = pos;
     this.owner = owner;
 }