コード例 #1
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string InitializeAdventureGetHuntExperience(Prospector prospector)
        {
            string messageBoxText =
                $"As you journey across the great Canadian Plains, you may have to hunt for food.\n" +
                "\n" +
                "Do you have an Prior Experience Hunting?";

            return(messageBoxText);
        }
コード例 #2
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string InitializeAdventureGetPriorKnowledge(Prospector prospector)
        {
            string messageBoxText =
                $"It's important to know where you'll be headed to this journey.\n" +
                "\n" +
                "Have you heard of Klondike Before?";

            return(messageBoxText);
        }
コード例 #3
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string InitializeAdventureGetTravelerAge(Prospector prospector)
        {
            string messageBoxText =
                $"From now on, you'll be known as {prospector.Name} on this adventure.\n" +
                "\n" +
                "Next, we need you to Enter your age below";

            return(messageBoxText);
        }
コード例 #4
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string TravelerInfo(Prospector gameTraveler)
        {
            string messageBoxText =
                $"\t Your Name and Title: {gameTraveler.title} {gameTraveler.Name}\n" +
                $"\t Your Age: {gameTraveler.Age}\n" +
                $"\t Your Address: {gameTraveler.ProspectorAddress}\n" +
                $"\t Your Health Status: {gameTraveler.PlayerHealthStatus}\n" +
                $"\t Your Hunting Experience: {gameTraveler.HasFishedHunted}\n" +
                $"\t Your Knowledge about Klondike: {gameTraveler.PriorKnowledge}\n" +
                $"\t Your Greeting: {gameTraveler.Greeting()}\n" +
                " \n";

            return(messageBoxText);
        }
コード例 #5
0
        private void InitializeAdventure()
        {
            Prospector prospector = _gameConsoleView.GetInitialTravelerInfo();

            _gamePlayer.Name = prospector.Name;
            _gamePlayer.Age  = prospector.Age;
            _gamePlayer.ProspectorAddress  = prospector.ProspectorAddress;
            _gamePlayer.title              = prospector.title;
            _gamePlayer.PlayerHealthStatus = prospector.PlayerHealthStatus;
            _gamePlayer.HasFishedHunted    = prospector.HasFishedHunted;
            _gamePlayer.PriorKnowledge     = prospector.PriorKnowledge;

            _gamePlayer.CurrentRegionLocationID = 1;
        }
コード例 #6
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string Travel(Prospector gametraveler, List <RegionLocation> regionLocations)
        {
            string messageBoxText =
                $"{gametraveler.Name}, Where would you like to head next?\n" +
                $"Note: Remember, journeys into the wilderness can be deadly, make sure\n" +
                $"your ready!" +
                $"\n" +
                $"Enter the ID number of your desired next location below.\n" +
                $"\n" +
                $"ID".PadRight(10) + "Name".PadRight(30) + "Accessible".PadRight(10) + "\n" +
                "---".PadRight(10) + "-------------------------".PadRight(30) + "-----------".PadRight(10) + "\n";

            string regionLocationList = null;

            foreach (RegionLocation rl in regionLocations)
            {
                if (rl.RegionLocationID == gametraveler.CurrentRegionLocationID)
                {
                    foreach (var locationNum in rl.CanTravelToNext)
                    {
                        foreach (RegionLocation selectedLoc in regionLocations)
                        {
                            if (selectedLoc.RegionLocationID == locationNum)
                            {
                                regionLocationList +=
                                    $"{selectedLoc.RegionLocationID}".PadRight(10);
                                if (gametraveler.RegionLocationsVisited.Contains(selectedLoc.RegionLocationID))
                                {
                                    regionLocationList +=
                                        $"{selectedLoc.CommonName}".PadRight(30);
                                }
                                else
                                {
                                    regionLocationList +=
                                        $"????????".PadRight(30);
                                }
                                regionLocationList +=
                                    $"{rl.Accessible}".PadRight(10) +
                                    Environment.NewLine;
                            }
                        }
                    }
                }
            }

            messageBoxText += regionLocationList;
            return(messageBoxText);
        }
コード例 #7
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string DisplayAccountInfo(Prospector gameTraveler)
        {
            string messageBoxText =
                $"Below is your Current Information" +
                " \n" +
                $"\t 1) Your Name: {gameTraveler.Name}\n" +
                $"\t 2) Your Title: {gameTraveler.title}\n" +
                $"\t 3) Your Age: {gameTraveler.Age}\n" +
                $"\t 4) Your Address: {gameTraveler.ProspectorAddress}\n" +
                $"\t 5) Your Health Status: {gameTraveler.PlayerHealthStatus}\n" +
                $"\t 6) Your Hunting Experience: {gameTraveler.HasFishedHunted}\n" +
                $"\t 7) Your Knowledge about Klondike: {gameTraveler.PriorKnowledge}\n" +
                " \n" +
                "Enter the corresponding number to which field you want to change.";

            return(messageBoxText);
        }
コード例 #8
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string InitializeMissionEchoTravelerInfo(Prospector gameTraveler)
        {
            string messageBoxText =
                $"Alrighty! Well {gameTraveler.title} {gameTraveler.Name}.\n" +
                " \n" +
                "You have successfully completed the paperwork. All information is" +
                " listed below.\n" +
                " \n" +
                $"\t Your Name and Title: {gameTraveler.title} {gameTraveler.Name}\n" +
                $"\t Your Age: {gameTraveler.Age}\n" +
                $"\t Your Address: {gameTraveler.ProspectorAddress}\n" +
                $"\t Your Health Status: {gameTraveler.PlayerHealthStatus}\n" +
                $"\t Your Hunting Experience: {gameTraveler.HasFishedHunted}\n" +
                $"\t Your Knowledge about Klondike: {gameTraveler.PriorKnowledge}\n" +
                " \n" +
                "Press any key to begin your adventure.";

            return(messageBoxText);
        }
コード例 #9
0
        private void editAccount()
        {
            int        playerChoice = _gameConsoleView.DisplayPlayerEdit(_gamePlayer);
            Prospector prospector   = _gameConsoleView.DisplayPlayerEditPrompt(playerChoice);

            switch (playerChoice)
            {
            case 0: break;

            case 1:
                _gamePlayer.Name = prospector.Name;
                break;

            case 2:
                _gamePlayer.title = prospector.title;
                break;

            case 3:
                _gamePlayer.Age = prospector.Age;
                break;

            case 4:
                _gamePlayer.ProspectorAddress = prospector.ProspectorAddress;
                break;

            case 5:
                _gamePlayer.PlayerHealthStatus = prospector.PlayerHealthStatus;
                break;

            case 6:
                _gamePlayer.HasFishedHunted = prospector.HasFishedHunted;
                break;

            case 7:
                _gamePlayer.PriorKnowledge = prospector.PriorKnowledge;
                break;

            default:
                break;
            }
            _gameConsoleView.DisplayUpdatedTravelerInfo(_gamePlayer);
        }
コード例 #10
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string InitializeAdventureGetTravelerHealth(Prospector gameTraveler)
        {
            string messageBoxText =
                $"{gameTraveler.title} {gameTraveler.Name}, this journey is very dangerous! For that reason, we need to know your general health before we begin\n" +
                "Please enter one of the following." +
                " \n";

            string statusList = null;

            foreach (Prospector.overallHealth status in Enum.GetValues(typeof(Prospector.overallHealth)))
            {
                if (status != Prospector.overallHealth.None)
                {
                    statusList += $"\t{status}\n";
                }
            }

            messageBoxText += statusList;

            return(messageBoxText);
        }
コード例 #11
0
ファイル: Text.cs プロジェクト: JacobBarsheff/TB-Quest-Game
        public static string InitializeMissionGetTravelerTitle(Prospector gameTraveler)
        {
            string messageBoxText =
                $"{gameTraveler.Name}, what of the following titles best suits you?\n" +
                " \n" +
                "Please enter one of the following." +
                " \n";

            string titleList = null;

            foreach (Character.Title title in Enum.GetValues(typeof(Character.Title)))
            {
                if (title != Character.Title.None)
                {
                    titleList += $"\t{title}\n";
                }
            }

            messageBoxText += titleList;

            return(messageBoxText);
        }
コード例 #12
0
        /// <summary>
        /// initialize the major game objects
        /// </summary>
        private void InitializeGame()
        {
            _gamePlayer      = new Prospector();
            _gameUniverse    = new Universe();
            _gameConsoleView = new ConsoleView(_gamePlayer, _gameUniverse);
            _playingGame     = true;
            ProspectorObject prospectorObject;

            foreach (GameObject gameObject in _gameUniverse.GameObjects)
            {
                if (gameObject is ProspectorObject)
                {
                    prospectorObject = gameObject as ProspectorObject;
                    prospectorObject.objectAddedToInventory += HandleObjectAddedToInventory;
                }
            }

            //
            //add initial items to the travelers inventory
            //
            _gamePlayer.Inventory.Add(_gameUniverse.GetGameObjectById(1) as ProspectorObject);

            Console.CursorVisible = false;
        }