示例#1
0
        public bool RemoveLayer(CellSurfaceLayer item)
        {
            bool result = _layers.Remove(item);

            if (_layers.Count == 0)
            {
                Cells = new Cell[Width * Height];

                for (int i = 0; i < Cells.Length; i++)
                {
                    Cells[i] = new Cell(DefaultForeground, DefaultBackground, 0);
                }

                OnCellsReset();
            }
            else
            {
                Cells = _layers[0].Cells;
            }

            IsDirty = true;

            return(result);
        }
示例#2
0
 public void InsertLayer(int index, CellSurfaceLayer item)
 {
     _layers.Insert(index, item);
     Cells   = _layers[0].Cells;
     IsDirty = true;
 }
示例#3
0
 public int IndexOf(CellSurfaceLayer item) => _layers.IndexOf(item);
示例#4
0
 public bool ContainsLayer(CellSurfaceLayer item) => _layers.Contains(item);
示例#5
0
 public void AddLayer(CellSurfaceLayer item)
 {
     _layers.Add(item);
     Cells   = _layers[0].Cells;
     IsDirty = true;
 }
示例#6
0
 public int IndexOf(CellSurfaceLayer item)
 {
     return(_layers.IndexOf(item));
 }