private ProspectorAction GetNextProspectorAction() { ProspectorAction prospectorAction = ProspectorAction.None; switch (ActionMenu.currentMenu) { case ActionMenu.CurrentMenu.MissionIntro: prospectorAction = _gameConsoleView.GetActionMenuChoice(ActionMenu.GameIntro); break; case ActionMenu.CurrentMenu.InitializeMission: prospectorAction = _gameConsoleView.GetActionMenuChoice(ActionMenu.InitializeMission); break; case ActionMenu.CurrentMenu.MainMenu: prospectorAction = _gameConsoleView.GetActionMenuChoice(ActionMenu.MainMenu); break; case ActionMenu.CurrentMenu.AdminMenu: prospectorAction = _gameConsoleView.GetActionMenuChoice(ActionMenu.AdminMenu); break; case ActionMenu.CurrentMenu.ManageInventory: prospectorAction = _gameConsoleView.GetActionMenuChoice(ActionMenu.useItem); break; case ActionMenu.CurrentMenu.ProspectorInfo: prospectorAction = _gameConsoleView.GetActionMenuChoice(ActionMenu.ProspectorInfo); break; case ActionMenu.CurrentMenu.NpcMenu: prospectorAction = _gameConsoleView.GetActionMenuChoice(ActionMenu.NpcMenu); break; default: break; } return(prospectorAction); }
/// <summary> /// method to manage the application setup and game loop /// </summary> private void ManageGameLoop() { ProspectorAction travelerActionChoice = ProspectorAction.None; // // display splash screen // _playingGame = _gameConsoleView.DisplaySpashScreen(); // // player chooses to quit // if (!_playingGame) { Environment.Exit(1); } // // display introductory message // _gameConsoleView.DisplayGamePlayScreen("Game Intro", Text.GameIntro(), ActionMenu.GameIntro, ""); _gameConsoleView.GetContinueKey(); // // initialize the mission prospector // InitializeAdventure(); // // prepare game play screen // _currentLocation = _gameUniverse.GetRegionLocationById(_gamePlayer.CurrentRegionLocationID); _gameConsoleView.DisplayGamePlayScreen("Current Location", Text.CurrrentLocationInfo(), ActionMenu.MainMenu, ""); // // game loop // while (_playingGame) { // // process all flags, events, and stats // UpdateGameStatus(); // // get next game action from player // // // get next game action from player // travelerActionChoice = GetNextProspectorAction(); // // choose an action based on the user's menu choice // switch (travelerActionChoice) { case ProspectorAction.None: break; case ProspectorAction.ProspectorInfo: ActionMenu.currentMenu = ActionMenu.CurrentMenu.ProspectorInfo; _gameConsoleView.DisplayTravelerInfo(); //_gameConsoleView.DisplayTravelerInfo(); break; case ProspectorAction.EditAccount: editAccount(); break; case ProspectorAction.LookAround: _gameConsoleView.DisplayLookAround(); break; case ProspectorAction.Travel: // // get new location choice and update the current location property // _gamePlayer.CurrentRegionLocationID = _gameConsoleView.DisplayGetNextRegionLocation(); _currentLocation = _gameUniverse.GetRegionLocationById((_gamePlayer).CurrentRegionLocationID); // // set the game play screen to the current location info format // _gameConsoleView.DisplayGamePlayScreen("Current Location", Text.CurrentLocationInfo(_currentLocation), ActionMenu.MainMenu, ""); break; case ProspectorAction.ProspectorInventory: _gameConsoleView.DisplayInventory(); break; case ProspectorAction.ProspectorLocationsVisited: _gameConsoleView.DisplayLocationsVisited(); break; case ProspectorAction.ListDestinations: _gameConsoleView.DisplayListOfRegionLocations(); break; case ProspectorAction.ListItems: _gameConsoleView.DisplayListOfAllGameObjects(); break; case ProspectorAction.AdminMenu: ActionMenu.currentMenu = ActionMenu.CurrentMenu.AdminMenu; _gameConsoleView.DisplayGamePlayScreen("Admin Menu", "Select an operation from the menu.", ActionMenu.AdminMenu, ""); break; case ProspectorAction.ReturnToMainMenu: ActionMenu.currentMenu = ActionMenu.CurrentMenu.MainMenu; _gameConsoleView.DisplayGamePlayScreen("Current Location", Text.CurrentLocationInfo(_currentLocation), ActionMenu.MainMenu, ""); break; case ProspectorAction.Exit: _playingGame = false; break; case ProspectorAction.LookAt: LookAtAction(); break; case ProspectorAction.PickUpItem: PickUpAction(); break; case ProspectorAction.PutDownItem: PutDownAction(); break; case ProspectorAction.Shop: if (_gameUniverse.GetRegionLocationById(_gamePlayer.CurrentRegionLocationID).CommonName == "Wilderness") { _gameConsoleView.DisplayCanNotVisitShop(); } else { Shop(); } break; case ProspectorAction.ManageInventory: ActionMenu.currentMenu = ActionMenu.CurrentMenu.ManageInventory; _gameConsoleView.DisplayGamePlayScreen("Manage Inventory", $"Please select an menu action you would like to do with the below items: \n{Text.CurrentInventory(_gamePlayer.Inventory)}", ActionMenu.useItem, ""); break; case ProspectorAction.ListNonPlayableCharacters: _gameConsoleView.DisplayListOfAllNpcObjects(); break; case ProspectorAction.TalkTo: TalkToAction(); break; case ProspectorAction.SellTo: SellItem(); break; case ProspectorAction.Interact: ActionMenu.currentMenu = ActionMenu.CurrentMenu.NpcMenu; _gameConsoleView.DisplayGamePlayScreen("Interact With NPC", "Please select an action!", ActionMenu.NpcMenu, ""); break; case ProspectorAction.ConsumeItem: ConsumeItem(); break; case ProspectorAction.WieldItem: WieldItem(); break; case ProspectorAction.PlayerInfoMenu: ActionMenu.currentMenu = ActionMenu.CurrentMenu.ProspectorInfo; _gameConsoleView.DisplayGamePlayScreen("Player Information", "Please select a menu option to your left to view Player Information", ActionMenu.ProspectorInfo, ""); break; default: break; } } // // close the application // Environment.Exit(1); }