Exemple #1
0
        public void Main()
        {
            Console.WriteLine("");
            Console.WriteLine("Please choose an option by entering a number.");
            Console.WriteLine("1. View Stats");
            Console.WriteLine("2. View Inventory");
            Console.WriteLine("3. Fight Monster");
            Console.WriteLine("4. Go To The Shop");
            Console.WriteLine("5. Equip Weapon");
            Console.WriteLine("6. Equip Armor");
            Console.WriteLine("7. Sip Some Sizzurp");
            Console.WriteLine("8. QUIT");
            Console.WriteLine("");
            Console.Write("Enter your selection: ");
            var input = Console.ReadLine();

            if (input == "1")
            {
                this.Stats();
            }
            else if (input == "2")
            {
                this.Inventory();
            }
            else if (input == "3")
            {
                this.Fight();
            }
            else if (input == "4")
            {
                Shop.Menu();
            }
            else if (input == "5")
            {
                Hero.EquipWeapon();
            }
            else if (input == "6")
            {
                Hero.EquipArmor();
            }
            else if (input == "7")
            {
                Hero.EquipPotion();
            }
            else if (input == "8")
            {
                Environment.Exit(0);
            }
            else
            {
                this.Main();
            }

            #region Switch Statement
            //switch (input) {
            ////switch on value of input
            //    case "1":
            //        Stats();
            //        break;
            //    case "2":
            //        Inventory();
            //        break;
            //    case "3":
            //        Fight();
            //        break;
            //    case "4":
            //        shop.Menu();
            //        break;
            //    case "5":
            //    default:
            //        return;
            //}
            #endregion
        }