Пример #1
0
        private void ShowMainWindow(SelectGameViewModel selectGameViewModel)
        {
            MainWindowViewModel viewModel = new MainWindowViewModel(new HexBoardViewModel(selectGameViewModel));

            MainWindow mainWindow = new MainWindow();
            mainWindow.DataContext = viewModel;
            this.MainWindow = mainWindow;

            mainWindow.Show();
        }
Пример #2
0
        public HexBoardViewModel(SelectGameViewModel gameData)
        {
            this.CanPlay = true;
            this.BoardSize = gameData.SelectedBoardSize;

            this.hexGame = new HexGame(this.BoardSize);
            this.Populate();

            this.gameSummary = new GameSummary(this.hexGame, gameData.GameType);

            this.computerSkillLevel = SkillLevelToDepth(gameData.SkillLevel);
            this.doComputerMoveCommand = new DoComputerMoveCommand(this.computerSkillLevel);
            this.CheckComputerMove();
        }