public ButtonCollection(Game game, EditorState editor) : base(game) { _editor = editor; ButtonCells = new Cell[] { new Cell(game, "a0"), new Cell(game, "b0"), new Cell(game, "b1"), new Cell(game, "c0"), new Cell(game, "c2"), new Cell(game, "d0"), new Cell(game, "z0") }; _activeCell = new ActiveCell(game); _components = new GameComponentCollection(); foreach (var button in ButtonCells) { _components.Add(new ButtonClick(button, SelectCell, button)); } _components.Add(_activeCell); _editor.SelectedType = ButtonCells[0].CellType; _activeCell.Current = ButtonCells[0]; }
public ButtonClick(Cell cell, Action <object> fn, object param) : base(cell.Game) { _current = cell; _tmp = new ActiveCell(cell.Game); _callbackFunc = fn; _callbackParam = param; cell.Game.Components.Add(_tmp); }
public CellMapHover(CellMap map) : base(map.Game) { _map = map; _mapCell = map.MapCell; _activeCell = new ActiveCell(map.Game); }