public ChessGridViewModel(IEventService <SettingsChangeEventArgs> eventService, IChessMoveParserService parserService, IEnginePlayerService engineService, IBoardGeneratorService generator, IChessRulesService rules, IChessGameService game)
 {
     this.eventService          = eventService;
     eventService.StateChanged += SettingChangedHandler;
     this.engineService         = engineService;
     engineService.InitPlayer(300);
     this.GameService      = game;
     this.generatorService = generator;
     this.rulesService     = rules;
     this.ChessGrid        = new ObservableCollection <Square>();
     this.parserService    = parserService;
 }
        public GameService([NotNull] IMessageBus messageBus, [NotNull] IBoardGeneratorService boardGeneratorService)
        {
            if (messageBus == null)
            {
                throw new ArgumentNullException(nameof(messageBus));
            }

            if (boardGeneratorService == null)
            {
                throw new ArgumentNullException(nameof(boardGeneratorService));
            }

            this.messageBus = messageBus;
            this.boardGeneratorService = boardGeneratorService;

            this.drill = Drill.CreateNew("Default", BoardTemplate.CreateEmpty(4, 4), BoardGoal.CreateCompleted(4, 4));
            this.InitialState = this.boardGeneratorService.Generate(this.drill.Template, this.drill.Goal);
            this.boardState = this.InitialState;
        }
Example #3
0
 public ChessGridViewModel(IBoardGeneratorService generator, IChessRulesService rulesService)
 {
     this.generatorService = generator;
     this.rulesService     = rulesService;
     this.ChessGrid        = new ObservableCollection <Square>();
 }