コード例 #1
0
        public GameController(ref Windows.UI.Xaml.Controls.Grid mainBoard,
                              ref Windows.UI.Xaml.Controls.TextBlock bestScore,
                              ref Windows.UI.Xaml.Controls.TextBlock actualScore)
        {
            LoadBoardSize();

            gameStatistic     = new Model.GameScoreModel();
            gameStatisticView = new View.GameScoreView(ref bestScore, ref actualScore);

            mainBoardGrid = mainBoard;
            gameModel     = new Model.GameBoardModel(this.boardSize, this.numberOfLayers);
            gameModelView = new View.GameBoardView(gameModel);

            gameModelView.InsertGameBoardIntoMainGrid(ref mainBoardGrid, 0, 1);

            StartGame();
        }
コード例 #2
0
 /// <summary>
 /// Method updates the value of the field with results
 /// </summary>
 /// <param name="statistic">GameScoreModel</param>
 public void UpdateStatistic(GameModel.GameScoreModel statistic)
 {
     bestScore.Text   = statistic.bestScore.ToString();
     actualScore.Text = statistic.score.ToString();
 }