public GameWindowViewModel(IGameConfigurationService gameConfigurationService, IEventAggregator eventAggregator, ISkinProcessor skinProcessor) { Guard.ArgumentNotNull(gameConfigurationService, nameof(gameConfigurationService)); Guard.ArgumentNotNull(eventAggregator, nameof(eventAggregator)); _gameConfigurationService = gameConfigurationService; _eventAggregator = eventAggregator; _skinProcessor = skinProcessor; BeginnerNewGameCommand = new DelegateCommand(() => StartNewGame(gameConfigurationService.BeginnerConfiguration)); AdvancedNewGameCommand = new DelegateCommand(() => StartNewGame(gameConfigurationService.AdvancedConfiguration)); ExpertNewGameCommand = new DelegateCommand(() => StartNewGame(gameConfigurationService.ExpertConfiguration)); AboutUsCommand = new DelegateCommand(() => new GameAboutUs().ShowDialog()); RulesCommand = new DelegateCommand(() => new GameRules().ShowDialog()); DefaultSkinCommand = new DelegateCommand(() => OnChangeSkin(SkinType.Default)); InvertedSkinCommand = new DelegateCommand(() => OnChangeSkin(SkinType.Inverted)); RadiatedSkinCommand = new DelegateCommand(() => OnChangeSkin(SkinType.Radiated)); SetUpInitialWindowSize(); SubscribeEvents(); }
/// <summary> /// Constructor /// </summary> /// <param name="boardService">Service responsible for creation of board</param> /// <param name="moveService">Service responsible for cell changes</param> /// <param name="gameConfigurationService"></param> public GamePlayController( IBoardService boardService, IMoveService moveService, IGameConfigurationService gameConfigurationService) { _boardService = boardService; _moveService = moveService; _gameConfigurationService = gameConfigurationService; }
public GameMinesViewModel(IGameConfigurationService gameConfigurationService, IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; _gameConfiguration = gameConfigurationService.DefaultConfiguration; _numberOfMines = _gameConfiguration.NumberOfMines; Redraw(); SubscribeEvents(); }
public GameGridViewModel(IGameConfigurationService gameConfigurationService, IEventAggregator eventAggregator) { Guard.ArgumentNotNull(gameConfigurationService, nameof(gameConfigurationService)); Guard.ArgumentNotNull(eventAggregator, nameof(eventAggregator)); _eventAggregator = eventAggregator; var configurationService = gameConfigurationService; GameConfiguration = configurationService.DefaultConfiguration; StartNewGame(); SubscribeToEvents(); }
public GameMenuViewModel(IEventAggregator eventAggregator, IGameConfigurationService configSrvice) { _eventAggregator = eventAggregator; _configService = configSrvice; RestartGameCommand = new DelegateCommand(RestartGame); BeginnerNewGameCommand = new DelegateCommand(() => StartNewGame(_configService.GetBeginnerConfig)); AdvancedNewGameCommand = new DelegateCommand(() => StartNewGame(_configService.GetAdvancedConfig)); ExpertNewGameCommand = new DelegateCommand(() => StartNewGame(_configService.GetExpertConfig)); }
/// <summary> /// Default Constructor /// </summary> /// <param name="gameConfigurationService"></param> public GameConfigurationController(IGameConfigurationService gameConfigurationService) { _gameConfigurationService = gameConfigurationService; }
/// <summary> /// Default Constructor /// </summary> /// <param name="gameConfiguration"></param> public BoardService(IGameConfigurationService gameConfigurationService) { _gameConfiguration = gameConfigurationService.GetGameConfiguration().Result; }