コード例 #1
0
        /// <summary>
        /// Create a ComponentList from UltimaSDK
        /// </summary>
        public MultiEditorComponentList(MultiComponentList list, MultiEditor.UserControls.MultiEditor parent)
        {
            _parent = parent;
            Width   = list.Width;
            Height  = list.Height;
            Tiles   = new List <MultiTile>();
            for (int x = 0; x < Width; ++x)
            {
                for (int y = 0; y < Height; ++y)
                {
                    for (int i = 0; i < list.Tiles[x][y].Length; ++i)
                    {
                        Tiles.Add(new MultiTile(
                                      list.Tiles[x][y][i].ID,
                                      x,
                                      y,
                                      list.Tiles[x][y][i].Z,
                                      list.Tiles[x][y][i].Flag));
                    }

                    Tiles.Add(new FloorTile(x, y, _parent.DrawFloorZ));
                }
            }

            CalcSolver();
            Tiles.Sort();
            UndoList  = new UndoStruct[_undoListMaxSize];
            _modified = true;
            RecalculateMinMax();
        }
コード例 #2
0
        /// <summary>
        /// Create a blank ComponentList
        /// </summary>
        public MultiEditorComponentList(int width, int height, MultiEditor.UserControls.MultiEditor parent)
        {
            _parent = parent;
            Width   = width;
            Height  = height;
            Tiles   = new List <MultiTile>();
            for (int x = 0; x < Width; ++x)
            {
                for (int y = 0; y < Height; ++y)
                {
                    Tiles.Add(new FloorTile(x, y, _parent.DrawFloorZ));
                }
            }

            UndoList  = new UndoStruct[_undoListMaxSize];
            _modified = true;
            RecalculateMinMax();
        }