Example #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);
        }
Example #2
0
 public void InsertLayer(int index, CellSurfaceLayer item)
 {
     _layers.Insert(index, item);
     Cells   = _layers[0].Cells;
     IsDirty = true;
 }
Example #3
0
 public int IndexOf(CellSurfaceLayer item) => _layers.IndexOf(item);
Example #4
0
 public bool ContainsLayer(CellSurfaceLayer item) => _layers.Contains(item);
Example #5
0
 public void AddLayer(CellSurfaceLayer item)
 {
     _layers.Add(item);
     Cells   = _layers[0].Cells;
     IsDirty = true;
 }
Example #6
0
 public int IndexOf(CellSurfaceLayer item)
 {
     return(_layers.IndexOf(item));
 }