MultiEditor.MultiEditorComponentList.Resize C# (CSharp) Method

Resize() public method

Resizes Multi size
public Resize ( int width, int height ) : void
width int
height int
return void
        public void Resize(int width, int height)
        {
            AddToUndoList("Resize");
            if ((Width > width) || (Height > height))
            {
                for (int i = Tiles.Count - 1; i >= 0; --i)
                {
                    MultiTile tile = Tiles[i];
                    if (tile.X >= width)
                        Tiles.RemoveAt(i);
                    else if (tile.Y >= height)
                        Tiles.RemoveAt(i);
                }
            }

            if ((Width < width) || (Height < height))
            {
                for (int x = 0; x < width; ++x)
                {
                    for (int y = 0; y < height; ++y)
                    {
                        if ((x < Width) && (y < Height))
                            continue;
                        Tiles.Add(new FloorTile(x, y, Parent.DrawFloorZ));
                    }
                }
            }
            Width = width;
            Height = height;
            Modified = true;
            RecalcMinMax();
        }