示例#1
0
        public void callPlanets()
        {
            Console.WriteLine("1 - Pharvis sells Golds.\n2 - Crystal sells Diamonds.\n3 - Shell sells fuel\n4 - Bigagua restores health\n5 - Stonks buys your items.\n6 - Earth ");
            Console.Write(">> ");
            string  location = Console.ReadLine().ToString();
            Planets p        = new Planets();

            Console.Clear();
            //         while (location != "1" && location != "2" && location != "3" && location != "4" && location != "5" && location != "6")
            //         {
            //             Console.WriteLine("Please input the correct planet");
            //             Console.WriteLine("1- Pharvis sells Golds.\n2- Crystal sells Diamonds.\n3- Shell sells fuel\n4- Bigagua restores health\n5- Stonks buys your items.\n6 - Earth ");
            //	Console.Write(">> ");
            //	location = Console.ReadLine().ToString();
            //}

            switch (location)
            {
            case "1":
                p.Pharvis();

                break;

            case "2":
                p.Crystal();
                break;

            case "3":
                p.Shell();
                break;

            case "4":
                p.Bigagua();
                break;

            case "5":
                p.Stonks();
                break;

            case "6":
                p.Earth();
                break;

            default:
                Console.Clear();
                Console.WriteLine("Please input the correct planet");
                callPlanets();
                break;
            }
        }