Exemplo n.º 1
0
        protected ATemplateVm(TemplateDto template, ITerminalTasks terminalTasks)
        {
            terminalTasks.notNull();
            template.notNull();

            Chance = new ChanceVm(template,terminalTasks);
            Keyboard = new TemplateKeyboardVm(terminalTasks);
        }
Exemplo n.º 2
0
        public TerminalVm(IStateService stateService, ITerminalEvents terminalEvents, ITerminalTasks terminalTasks)
        {
            this.terminalTasks = terminalTasks.notNull();
            this.stateService = stateService.notNull();
            this.terminalEvents = terminalEvents.notNull();

            currentState = stateService.CurrentState;
            terminalEvents.EndOfService += (s, e) => terminalEvents_EndOfTask_handling();
            terminalEvents.OnTouchNumber += (s, e) => terminalEvents_OnTouchNumber_handling();
        }
Exemplo n.º 3
0
 public GameKeyboardVm(ITerminalTasks terminalTasks)
 {
     terminalTasks.notNull();
     Commands = new[] {
         new CommandVm("Regular Template",new Command(action => terminalTasks.newRegularPlayslip())),
         new CommandVm("Combo Template", new Command(action => terminalTasks.newComboPlayslip())),
         new CommandVm("Restart", new Command(action => terminalTasks.restart())),
         new CommandVm("Play", new Command(action => terminalTasks.play()))
     };
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        public FiledPlayslipsVm(IEnumerable<FiledPlayslipDto> filedPlayslips, ITerminalTasks terminalTasks)
        {
            terminalTasks.notNull();
            filedPlayslips.notNull();

            Commands = new List<FiledPlayslipVm>(
                filedPlayslips.Select(filedPlayslip =>
                    new FiledPlayslipVm(
                        filedPlayslip,
                        new Command(action => terminalTasks.reviewPlayslip(filedPlayslip.RefId))
                    )
                )
            );
        }
Exemplo n.º 6
0
 // todo: passing a hard-wired cmd's is not nice
 public TemplateKeyboardVm(ITerminalTasks terminalTasks)
 {
     terminalTasks.notNull();
     Commands = new[] {
         new CommandVm("Quick",
             new Command(action => terminalTasks.quickTemplate())),
         new CommandVm("Store",
             new Command(action => terminalTasks.fileTemplate())),
         new CommandVm("Drop",
             new Command(action => terminalTasks.dropTemplate())),
         new CommandVm("Clear",
             new Command(action => terminalTasks.clearTemplate()))
     };
 }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
        public ChanceVm(TemplateDto template, ITerminalTasks terminalTasks)
        {
            terminalTasks.notNull();
            Nr = template.Nr;
            HasSpiel77 = template.HasSpiel77;
            HasSuper6 = template.HasSuper6;

            // TODO: yes/no is clearly a datatrigger's concern...
            Commands = new[] {
                new CommandVm("Losnummer: " + Nr,
                    new Command(action => terminalTasks.changeLosnummer())),
                new CommandVm("Spiel 77: " + (HasSpiel77 ? "YES" : "NO"),
                    new Command(action => terminalTasks.touchSpiel77())),
                new CommandVm("Super 6: "+ (HasSuper6 ? "YES" : "NO"),
                    new Command(action => terminalTasks.touchSuper6())),
            };
        }
Exemplo n.º 9
0
 public TemplateRVm(TemplateDto template, ITerminalEvents terminalEvents, ITerminalTasks terminalTasks)
     : base(template, terminalTasks)
 {
     boards = template.Boards.Select(board => new BoardRVm(board, terminalEvents, terminalTasks));
 }
 public EventWrappedTerminalTasks(ITerminalTasks eventWrapped)
 {
     this.terminalTasks = eventWrapped.notNull();
 }
Exemplo n.º 11
0
 public ComboSelector(BoardDto board, ITerminalTasks terminalTasks)
 {
     ts = terminalTasks.notNull();
     b = board.notNull();
 }
Exemplo n.º 12
0
 public TemplateController(ITerminalTasks terminalTasks)
 {
     this.terminalTasks = terminalTasks.notNull();
 }
Exemplo n.º 13
0
 public BoardCVm(BoardDto board, ITerminalEvents terminalEvents, ITerminalTasks terminalTasks)
     : base(board, terminalEvents, terminalTasks)
 {
     Description = board.Combo + " of 49";
     Combo = new ComboSelector(board, terminalTasks);
 }
Exemplo n.º 14
0
 public SelectionController(ITerminalTasks terminalTasks)
 {
     this.terminalTasks = terminalTasks.notNull();
 }
Exemplo n.º 15
0
 public BoardRVm(BoardDto board, ITerminalEvents terminalEvents, ITerminalTasks terminalTasks)
     : base(board, terminalEvents, terminalTasks)
 {
 }
Exemplo n.º 16
0
        public BoardKeyboardVm(string position, ITerminalTasks terminalTasks)
        {
            terminalTasks.notNull();

            Commands = new[] {
                new CommandVm("Quick",
                    new Command(action => terminalTasks.quickBoard(position))),
                new CommandVm("Clear",
                    new Command(action => terminalTasks.clearBoard(position))),
            };
        }
Exemplo n.º 17
0
 public ScopedTerminalTasks(ITerminalTasks scoped, IContextManager contextManager)
 {
     terminalTasks = scoped.notNull();
     this.contextManager = contextManager.notNull();
 }