Пример #1
0
        /// <summary>
        /// initialize the major game objects
        /// </summary>
        private void InitializeGame()
        {
            _gameTraveler    = new Traveler();
            _gameUniverse    = new Universe();
            _gameConsoleView = new ConsoleView(_gameTraveler, _gameUniverse);
            TravelerObject travelerObject;

            _playingGame = true;

            //
            // add the event handler for adding/subtracting to/from inventory
            //
            foreach (GameObject gameObject in _gameUniverse.GameObjects)
            {
                if (gameObject is TravelerObject)
                {
                    travelerObject = gameObject as TravelerObject;
                    travelerObject.ObjectAddedToInventory += HandleObjectAddedToInventory;
                }
            }

            Console.CursorVisible = false;
        }