protected ABoardVm(BoardDto board, ITerminalEvents terminalEvents, ITerminalTasks terminalTasks) { board.notNull(); terminalEvents.OnTouchNumber += (s, e) => terminalEvents_OnTouchNumber_handling(e.Value); this.terminalTasks = terminalTasks.notNull(); Position = board.Position; Numbers = new GuessKeyboardVm(board, terminalTasks); Keyboard = new BoardKeyboardVm(Position, terminalTasks); }
public GuessKeyboardVm(BoardDto board, ITerminalTasks terminalTasks) { terminalTasks.notNull(); board.notNull(); var cmds = new List<CommandWithStateVm>(49); for(byte i = 1; i <= 49; i++){ byte nr = i; // BEWARE OF ACCESS TO MODIFIED CLOSURE ! cmds.Add( new CommandWithStateVm(board.Numbers.Contains(nr), nr.ToString(), new Command(action => terminalTasks.touchNumber(board.Position, nr)))); } this.Commands = cmds; IsInvalid = board.IsInvalid; IsWin = board.IsWin; }
public ComboSelector(BoardDto board, ITerminalTasks terminalTasks) { ts = terminalTasks.notNull(); b = board.notNull(); }
public BoardCVm(BoardDto board, ITerminalEvents terminalEvents, ITerminalTasks terminalTasks) : base(board, terminalEvents, terminalTasks) { Description = board.Combo + " of 49"; Combo = new ComboSelector(board, terminalTasks); }
void terminalEvents_OnTouchNumber_handling(BoardDto board) { if(null == board || !this.Position.Equals(board.Position)) return; this.Numbers = new GuessKeyboardVm(board, this.terminalTasks); this.render(); }
public BoardRVm(BoardDto board, ITerminalEvents terminalEvents, ITerminalTasks terminalTasks) : base(board, terminalEvents, terminalTasks) { }