public void OnDelete()
        {
            if (_levelList.CurrentSelectedLevel == null)
            {
                return;
            }
            var delCom = new ComDeleteLevel(_levelList, _levelList.CurrentSelectedLevel);

            delCom.Execute();
            _comList.Add(delCom);
        }
Ejemplo n.º 2
0
        void OnBrushIndex(int idx)
        {
            Debug.Log("I'm brushed " + idx);
            BrushData brushData = brushList.CurrentBrush;

            if (brushData == null)
            {
                Debug.LogWarning("没有选择画刷");
                return;
            }

            int      gridX    = _coord.GetGridX(idx);
            int      gridY    = _coord.GetGridY(idx);
            ICommand brushCom = new ComBrushAt(_board, brushData, gridX, gridY);

            if (brushCom.Execute())
            {
                _comList.Add(brushCom);
            }
            else
            {
                Debug.LogWarning("can't place brush at this position: (" + gridX + "," + gridY + ")");
            }
        }