Exemplo n.º 1
0
        public void DisplayLocationsVisisted()
        {
            //create a list of locations that survivor has been to
            List <WorldLocations> visitedLocations = new List <WorldLocations>();

            foreach (int locationId in _gameSurvivor.LocationsVisited)
            {
                visitedLocations.Add(_worldContents.GetLocationById(locationId));
            }

            DisplayGamePlayScreen("Locations you've been too", Text.VisitedLocations(visitedLocations), ActionMenu.SurvivorMenu, "");
        }
Exemplo n.º 2
0
        /// <summary>
        /// method to manage the application setup and game loop
        /// </summary>
        private void ManageGameLoop()
        {
            SurvivorAction survivorActionChoice = SurvivorAction.None;

            //
            // display splash screen
            //
            _playingGame = _gameConsoleView.DisplaySpashScreen();

            //
            // player chooses to quit
            //
            if (!_playingGame)
            {
                Environment.Exit(1);
            }

            //
            // display introductory message
            //
            _gameConsoleView.DisplayGamePlayScreen("Intro", Text.MissionIntro(), ActionMenu.MissionIntro, "");
            _gameConsoleView.GetContinueKey();

            //
            // initialize the mission traveler
            //
            InitializeMission();

            //
            // prepare game play screen
            //
            _gameConsoleView.DisplayGamePlayScreen("Current Location", Text.CurrrentLocationInfo(), ActionMenu.MainMenu, "");
            _currentLocation = _worldContents.GetLocationById(_gameSurvivor.LocationId);


            //
            // game loop
            //
            while (_playingGame)
            {
                UpdateGameStatus();
                // _gameConsoleView.DisplayStatusBox();

                //get next action choice
                survivorActionChoice = GetNextSurvivorAction();

                // choose an action based on the user's menu choice
                switch (survivorActionChoice)
                {
                case SurvivorAction.None:
                    break;

                case SurvivorAction.SurvivorInfo:
                    _gameConsoleView.DisplaySurvivorInfo();
                    break;

                case SurvivorAction.ListLocations:
                    _gameConsoleView.DisplayListOfLocations();
                    break;

                case SurvivorAction.LookAround:
                    _gameConsoleView.DisplayLookAround();
                    break;

                case SurvivorAction.Travel:
                    //get new location choice and update current location
                    _gameSurvivor.LocationId = _gameConsoleView.GetNextLocation();
                    _currentLocation         = _worldContents.GetLocationById(_gameSurvivor.LocationId);

                    //set gameplayscreen as current location info
                    _gameConsoleView.DisplayGamePlayScreen("Current Location", Text.CurrentLocationInfo(_currentLocation),
                                                           ActionMenu.MainMenu, "");
                    break;

                case SurvivorAction.SurvivorLocationsVisited:
                    _gameConsoleView.DisplayLocationsVisisted();
                    //_gameConsoleView.DisplayStatusBox();
                    break;

                case SurvivorAction.ListGameObjects:
                    _gameConsoleView.DisplayListOfGameObjects();
                    // _gameConsoleView.DisplayStatusBox();
                    break;

                case SurvivorAction.DisplayNonPlayableCharacters:
                    _gameConsoleView.DisplayListOfNpcObjects();
                    break;

                case SurvivorAction.LookAt:
                    LookAtAction();
                    break;

                case SurvivorAction.PickUp:
                    PickUpAction();
                    break;

                case SurvivorAction.PutDown:
                    PutDownAction();
                    break;

                case SurvivorAction.TalkTo:
                    TalkToAction();
                    break;

                case SurvivorAction.Inventory:
                    _gameConsoleView.DisplayInventory();
                    break;

                case SurvivorAction.AdminMenu:
                    ActionMenu.currentMenu = ActionMenu.CurrentMenu.AdminMenu;
                    _gameConsoleView.DisplayGamePlayScreen("Admin Menu", "Select an option from the menu",
                                                           ActionMenu.AdminMenu, "");
                    break;

                case SurvivorAction.ReturnToMainMenu:
                    ActionMenu.currentMenu = ActionMenu.CurrentMenu.MainMenu;
                    _gameConsoleView.DisplayGamePlayScreen("Current Location", Text.CurrentLocationInfo(_currentLocation),
                                                           ActionMenu.MainMenu, "");
                    break;

                case SurvivorAction.ObjectMenu:
                    ActionMenu.currentMenu = ActionMenu.CurrentMenu.ObjectMenu;
                    _gameConsoleView.DisplayGamePlayScreen("Object Menu", "Select an action from the menu.",
                                                           ActionMenu.ObjectMenu, "");
                    break;

                case SurvivorAction.SurvivorMenu:
                    ActionMenu.currentMenu = ActionMenu.CurrentMenu.SurvivorMenu;
                    _gameConsoleView.DisplayGamePlayScreen("Survivor Menu", "Select an option from the menu.",
                                                           ActionMenu.SurvivorMenu, "");
                    break;

                case SurvivorAction.NonplayerCharacterMenu:
                    ActionMenu.currentMenu = ActionMenu.CurrentMenu.NpcMenu;
                    _gameConsoleView.DisplayGamePlayScreen("NPC Menu", "Select an option from the menu.",
                                                           ActionMenu.NpcMenu, "");
                    break;

                case SurvivorAction.Exit:
                    _playingGame = false;
                    break;



                default:
                    break;
                }
            }

            //
            // close the application
            //
            Environment.Exit(1);
        }