Exemple #1
0
        public void AddBuilding(CompressedBuilding building)
        {
            buildingList.Add(building);

            int p = -1;

            for (int i = buildingList.Count - 1; i >= 0; i--)
            {
                if (buildingList[i].id == building.id)
                {
                    buildingList.RemoveAt(i);
                    p = i;
                }
            }

            if (p > -1)
            {
                buildingList.Insert(p, building);
            }
            else
            {
                buildingList.Add(building);
            }

            Data.SaveBuildingsBinary(this);
        }
Exemple #2
0
        public BorderMap(CompressedBuilding compressedBuilding, EditorParams editorParams)
        {
            this.editorParams       = editorParams;
            this.compressedBuilding = compressedBuilding;
            normalBorderMap         = new Border[editorParams.overallSize, editorParams.overallSize];
            roadList = new List <GroundLayer>();

            highlight         = new Border(11, 0, 0, 5);
            highlight.visible = false;

            for (int x = 0; x < editorParams.overallSize; x++)
            {
                for (int y = 0; y < editorParams.overallSize; y++)
                {
                    normalBorderMap[x, y] = new Border(20, x, y, 2);
                }
            }

            for (int x = 0; x < editorParams.overallSize; x++)
            {
                if (compressedBuilding.baseDirectionFacing == 0)
                {
                    roadList.Add(GroundLayerController.GetLayerByIndex(LayerType.CITYROAD, 2)); //North
                }
                else
                {
                    roadList.Add(GroundLayerController.GetLayerByIndex(LayerType.CITYROAD, 1));  //West
                }
            }
        }