Esempio n. 1
0
        private int GameDifficultySet()
        {
            for (int i = 0; i < 5; i++)
            {
                CDisp.DisplayToUser("Please set game level: from 1 to 3. (1=easy)");
                string preLevel = CDisp.GetResponseFromUser();

                try
                {
                    int preLevelInt = Int32.Parse(preLevel);
                    if (preLevelInt <= 3 || preLevelInt > 0)
                    {
                        return(preLevelInt);
                    }
                    throw new Exception("PreLevel input out of scope!");
                }
                catch
                {
                    CDisp.DisplayToUser("Game Level cannot be set to: " + preLevel + ", try again.");
                }
            }
            throw new Exception("Too many attemts during game difficulty set.");
        }
Esempio n. 2
0
        public void Load()
        {
            do
            {
                CDisp.MainMenu();
                Result = CDisp.GetResponseFromUser();
                switch (Result)
                {
                case "play":     //MainMenuType.play.ToString():
                    new Game().GameStart();
                    break;

                case "about":
                    CDisp.GameAbout();
                    break;
                }
            } while (Result != MainMenuType.exit.ToString());
        }
Esempio n. 3
0
        private void Play()
        {
            Travel travel = new Travel();
            string result;

            do
            {
                CDisp.GamePlay(Player.location.Name);
                result = CDisp.GetResponseFromUser();
                switch (result)
                {
                case "travel":
                    travel.TravelTo(Player, World);
                    travel.TravelComplete(Player);
                    break;

                case "barter":
                    // todo barter
                    break;
                }
                NextTurn();
            } while (result != "exit" || Turn >= TURN_LIMIT);
        }