Example #1
0
        /// <summary>
        /// initialize the player info
        /// </summary>
        private void InitializeMission()
        {
            Traveler traveler = _gameConsoleView.GetInitialTravelerInfo();

            _gameTraveler.Name         = traveler.Name;
            _gameTraveler.Age          = traveler.Age;
            _gameTraveler.Ethnicity    = traveler.Ethnicity;
            _gameTraveler.HomeLocation = traveler.HomeLocation;

            _gameTraveler.Experiencepoints = 0;
            _gameTraveler.Health           = 100;
            _gameTraveler.Lives            = 3;
        }
Example #2
0
        /// <summary>
        /// get the player's initial information at the beginning of the game
        /// </summary>
        /// <returns>traveler object with all properties updated</returns>
        public Traveler GetInitialTravelerInfo()
        {
            Traveler traveler = new Traveler();

            //
            // intro
            //
            DisplayGamePlayScreen("Journey Initialization", Text.InitializeMissionIntro(), ActionMenu.MissionIntro, "");
            GetContinueKey();

            //
            // get traveler's name
            //
            DisplayGamePlayScreen("Journey Initialization - Name", Text.InitializeMissionGetTravelerName(), ActionMenu.MissionIntro, "");
            DisplayInputBoxPrompt("Enter your name: ");
            traveler.Name = GetString();

            //
            // get traveler's age
            //
            DisplayGamePlayScreen("Journey Initialization - Age", Text.InitializeMissionGetTravelerAge(traveler), ActionMenu.MissionIntro, "");
            int gameTravelerAge;

            GetInteger($"Enter your age {traveler.Name}: ", 0, 1000000, out gameTravelerAge);
            traveler.Age = gameTravelerAge;

            //
            // get traveler's race
            //
            DisplayGamePlayScreen("Journey Initialization - Ethnicity", Text.InitializeMissionGetTravelerEthnicity(traveler), ActionMenu.MissionIntro, "");
            DisplayInputBoxPrompt($"Enter your ethnicity {traveler.Name}: ");
            traveler.Ethnicity = GetEthnicity();

            //
            //get home location
            //
            DisplayGamePlayScreen("Journey Initialization - Home Location", Text.InitializeMissionTravelerHomeLocation(traveler.Name), ActionMenu.MissionIntro, "");
            DisplayInputBoxPrompt($"Enter your home location:");
            traveler.HomeLocation = GetString();


            //
            // echo the traveler's info
            //
            DisplayGamePlayScreen("Journey Initialization - Complete", Text.InitializeMissionEchoTravelerInfo(traveler), ActionMenu.MissionIntro, "");
            GetContinueKey();

            _viewStatus = ViewStatus.PlayingGame;

            return(traveler);
        }
Example #3
0
        public static string TravelerInfo(Traveler gameTraveler)
        {
            string messageBoxText =
                $"\tTraveler Name: {gameTraveler.Name}\n" +
                $"\tTraveler Age: {gameTraveler.Age}\n" +
                $"\tTraveler Ethnicity: {gameTraveler.Ethnicity}\n" +
                $"\t Traveler Home Location:{gameTraveler.HomeLocation}\n" +
                "\n" +
                "\n" +
                $"\t {gameTraveler.Greeting()} \n" +
                " \n";

            return(messageBoxText);
        }
Example #4
0
        /// <summary>
        /// initialize the major game objects
        /// </summary>
        private void InitializeGame()
        {
            _gameTraveler    = new Traveler();
            _gameShip        = new Ship();
            _gameConsoleView = new ConsoleView(_gameTraveler, _gameShip);
            _playingGame     = true;


            //add items to travelers invy
            //
            _gameTraveler.Inventory.Add(_gameShip.GetGameObjectById(8) as TravelerObject);
            _gameTraveler.Inventory.Add(_gameShip.GetGameObjectById(9) as TravelerObject);


            Console.CursorVisible = false;
        }
Example #5
0
        public static string InitializeMissionEchoTravelerInfo(Traveler gameTraveler)
        {
            string messageBoxText =
                $"Very good then {gameTraveler.Name}.\n" +
                " \n" +
                "It appears we have all the necessary data to begin your journey. You will find it" +
                " listed below.\n" +
                " \n" +
                $"\tTraveler Name: {gameTraveler.Name}\n" +
                $"\tTraveler Age: {gameTraveler.Age}\n" +
                $"\tTraveler Ethnicity: {gameTraveler.Ethnicity}\n" +
                $"\tTraveler Home Location: {gameTraveler.HomeLocation}\n" +
                " \n" +
                "Press any key to begin your journey.";

            return(messageBoxText);
        }
Example #6
0
        public static string InitializeMissionGetTravelerEthnicity(Traveler gameTraveler)
        {
            string messageBoxText =
                $"{gameTraveler.Name}, it will be important for us to know your ethnicity on this mission.\n" +
                " \n" +
                "Enter your ethnicity below.\n" +
                " \n" +
                "Please use the ethnicity classifications below." +
                " \n";

            string raceList = null;

            foreach (Character.EthnicityType race in Enum.GetValues(typeof(Character.EthnicityType)))
            {
                if (race != Character.EthnicityType.None)
                {
                    raceList += $"\t{race}\n";
                }
            }

            messageBoxText += raceList;

            return(messageBoxText);
        }
Example #7
0
        public static string Travel(Traveler gameTraveler, List <Location> locations)
        {
            string messageBoxText =
                $"{gameTraveler.Name}, Were would you like to travel next? \n" +
                "\n" +
                "Enter the ID number of your desired location from the table below.\n" +
                "\n" +

                //
                // table header
                //

                "ID".PadRight(10) + "Name".PadRight(30) + "Accessable".PadRight(10) + "\n" +
                "---".PadRight(10) + "------------------------".PadRight(30) + "----------".PadRight(10) + "\n";

            //
            // display travel locaions
            //
            string locationList = null;

            foreach (Location location in locations)
            {
                if (location.LocationID != gameTraveler.LocationID)
                {
                    locationList +=
                        $"{location.LocationID}".PadRight(10) +
                        $"{location.CommonName}".PadRight(30) +
                        $"{location.Accessable}".PadRight(10) +
                        Environment.NewLine;
                }
            }

            messageBoxText += locationList;

            return(messageBoxText);
        }