示例#1
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
                }
            }
        }
示例#2
0
 public CompressedBuilding(int pieceRow, int baseDirectionFacing, EditorParams editorParams)
 {
     this.editorParams        = editorParams;
     availableColoursXMLList  = new List <ColorXML>();
     this.pieceRow            = pieceRow;
     this.baseDirectionFacing = baseDirectionFacing;
     usingWidth  = 10;
     usingHeight = 10;
     elevation   = 3;
     inTileShift = 0;
     pieceMap    = new int[editorParams.overallSize, editorParams.overallSize];
     for (int x = 0; x < editorParams.overallSize; x++)
     {
         for (int y = 0; y < editorParams.overallSize; y++)
         {
             pieceMap[x, y] = -1;
         }
     }
     shadowList = new List <EditorShadow>();
 }
示例#3
0
 //must call this on loading or creating a new building in the editor as the editor params are not serialized or saved to xml
 public void InitOld(EditorParams editorParams)
 {
     this.editorParams = editorParams;
 }