Пример #1
0
 public MainWindowViewModel(IMenuViewModel menuViewModel,
                            IGameBoardViewModel gameBoardViewModel,
                            IGameInfoViewModel gameInfoViewModel,
                            IGamePlay gamePlay,
                            IPlayerController playerController)
 {
     _menuViewModel      = menuViewModel ?? throw new ArgumentNullException(nameof(menuViewModel));
     _gameBoardViewModel = gameBoardViewModel ?? throw new ArgumentNullException(nameof(gameBoardViewModel));
     _gameInfoViewModel  = gameInfoViewModel ?? throw new ArgumentNullException(nameof(gameInfoViewModel));
     _gamePlay           = gamePlay ?? throw new ArgumentNullException(nameof(gamePlay));
     _playerController   = playerController ?? throw new ArgumentNullException(nameof(playerController));
 }
Пример #2
0
        public MenuViewModel(IGameBoardViewModel gameBoardViewModel,
                             IGameInfoViewModel gameInfoViewModel,
                             IPlayerController playerController)
        {
            _gameBoardViewModel = gameBoardViewModel ?? throw new ArgumentNullException(nameof(gameBoardViewModel));
            _gameInfoViewModel  = gameInfoViewModel ?? throw new ArgumentNullException(nameof(gameInfoViewModel));
            _playerController   = playerController ?? throw new ArgumentNullException(nameof(playerController));
            _playerX            = _playerController.PlayerX;
            _playerO            = _playerController.PlayerO;

            StartGameCommand          = new RelayCommand(StartGameExecute, StartGameCanExecute);
            StartNewGameCommand       = new RelayCommand(StartNewGameExecute, StartNewGameCanExecute);
            PlayerSelectStartLastGame = new RelayCommand(PlayerSelectStartLastGameExecute, PlayerSelecttartLastGameCanExecute);
        }