Beispiel #1
0
        /// <summary>
        /// The constructor takes a View_Base object (or an instance of any derived class) in order
        /// to store it for later use.
        /// </summary>
        private Presenter()
        {
            //DEBUG     Logging.I.LogMessage("Calling constructor of Presenter.\n");

            _view = null;

            // Initially, there is no game running:
            _gameStatus = GameStatus.Ended;

            // Create the game board, defining the number of pits per player:
            _modelGameBoard = new Kalaha.Model.GameBoard();

            // Create the two players:
            _southPlayer = new Player(Player.Position.South);
            _northPlayer = new Player(Player.Position.North);

            // Start with an empty undo list:
            _undoManager = new UndoManager();

            // Restore previously saved values for all kinds of settings:
            string restoredThemeName = "";
            GameStorage.I.RestoreSavedValues(ref _southPlayer, ref _northPlayer, ref restoredThemeName);
            SwitchToRestoredTheme(restoredThemeName);

            // Define the southern player to start first:
            _playerWhoIsFirst = _southPlayer;          //TODO: Restore the first player from the saved values.

            // Set the HubPage workaround to "don't show explanation":
            _tellHubPageToShowThemeExplanation = false;
        }
Beispiel #2
0
 /// <summary>
 /// Takes a View_Base object (or an instance of any derived class) in order
 /// to store it for later use.
 /// </summary>
 public void SetView(GamePage view)
 {
     _view = view;
 }