public static void CollectInput(Farm farm)
        {
            Console.WriteLine("1. Seed Harvester");
            Console.WriteLine("2. Meat Processor");
            Console.WriteLine("3. Egg Gatherer");
            Console.WriteLine("4. Composter");
            Console.WriteLine("5. Feather Harvester");

            Console.WriteLine();

            Console.WriteLine("Choose equipment to use.");

            Console.Write("> ");
            string choice = Console.ReadLine();

            try
            {
                switch (Int32.Parse(choice))
                {
                case 1:
                    ChooseSeedHarvester.CollectInput(farm, new SeedHarvester());
                    break;

                // case 2:
                //     ChooseMeatHarvester.CollectInput(farm, new MeatProcessor());
                //     break;
                case 3:
                    ChooseEggHarvester.CollectInput(farm, new EggHarvester());
                    break;

                case 4:
                    ChooseComposter.CollectInput(farm, new Composter());
                    break;

                case 5:
                    ChooseFeatherHarvester.CollectInput(farm, new FeatherHarvester());
                    break;

                default:
                    break;
                }
            }
            catch (FormatException ex)
            {
                Console.WriteLine(ex);
            }
        }
예제 #2
0
        public static void CollectInput(Farm farm)
        {
            Console.WriteLine("1. Seed Harvester");
            Console.WriteLine("2. Meat Processor");
            Console.WriteLine("3. Egg Gatherer");
            Console.WriteLine("4. Composter");
            Console.WriteLine("5. Feather Harvester");

            Console.WriteLine();
            Console.WriteLine("Choose equipment to use.");

            Console.Write("> ");
            string choice = Console.ReadLine();

            switch (Int32.Parse(choice))
            {
            case 1:
                ChooseSeedHarvester.CollectInput(farm);
                break;

            case 2:
                ChooseMeatProcessor.CollectInput(farm);
                break;

            case 3:
                ChooseEggGatherer.CollectInput(farm);
                break;

            case 4:
                ChooseComposter.CollectInput(farm);
                break;

            case 5:
                ChooseFeatherHarvester.CollectInput(farm);
                break;

            default:
                Console.WriteLine();
                Console.WriteLine("Invalid input! Press any key to return home");
                Console.ReadLine();
                break;
            }
        }
        public static void CollectInput(Farm farm)
        {
            Console.WriteLine("1. Meat processor");
            Console.WriteLine("2. Egg gatherer");
            Console.WriteLine("3. Feather harvester");
            Console.WriteLine("4. Composter");
            Console.WriteLine("5. Seed harvester");

            Console.WriteLine();
            Console.WriteLine("Choose equipment to use");

            Console.Write("> ");
            string input = Console.ReadLine();

            switch (Int32.Parse(input))
            {
            case 1:
                ChooseMeatProcessor.CollectInput(farm);
                break;

            case 2:
                // ChooseEggGatherer.CollectInput(farm);
                break;

            case 3:
                ChooseFeatherHarvester.CollectInput(farm);
                break;

            case 4:
                ChooseComposter.CollectInput(farm);
                break;

            case 5:
                //  ChooseSeedHarvester.CollectInput(farm);
                break;

            default:
                break;
            }
        }