Ejemplo n.º 1
0
        public void Buy()
        {
            GoodyBag g = new GoodyBag();

            Console.Clear();
            Console.WriteLine("What do you want to buy?");
            Console.WriteLine("Buy my crap");
            Console.WriteLine("1. I want it. Give it to me!!");
            Console.WriteLine("2. That is way to much. Get bent NERD!!");
            string pick = Console.ReadLine();
            int    option;

            while (!int.TryParse(pick, out option))
            {
                Buy();
                pick = Console.ReadLine();
            }
            if (option >= 1 && option <= 2)
            {
                switch (option)
                {
                case 1:
                    g.buy();
                    break;

                case 2:
                    BuyNegotiate();
                    break;
                }
            }
            else
            {
                Console.WriteLine("Invalid number try again.");
                Console.ReadLine();
                PlanetMenu();
            }
        }
Ejemplo n.º 2
0
        public void BuyNegotiate()
        {
            GoodyBag g = new GoodyBag();

            Console.WriteLine("Seriuosly?");
            Console.WriteLine("This is what I'm willing to do\n");
            Console.WriteLine("1. Yes, give that thang.");
            Console.WriteLine("2. No, thats a terrible offer.");
            string pick = Console.ReadLine();
            int    option;

            while (!int.TryParse(pick, out option))
            {
                BuyNegotiate();
                pick = Console.ReadLine();
            }
            if (option >= 1 && option <= 2)
            {
                switch (option)
                {
                case 1:
                    g.buy();
                    break;

                case 2:
                    PlanetMenu();
                    break;
                }
            }
            else
            {
                Console.WriteLine("Invalid number try again.");
                Console.ReadLine();
                BuyNegotiate();
            }
        }