public static void CollectInput(Farm farm)
        {
            Console.WriteLine("1.Meat Processor ");



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

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

            switch (choice)
            {
            case "1":
                ChooseMeatProcessor.CollectInput(farm);
                break;


            default:
                Console.WriteLine($"Invalid option");
                Console.WriteLine();
                break;
            }
        }
示例#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;
            }
        }
        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 (choice)
            {
            case "1":
                //  ChooseChickenHouse.CollectInput(farm, amount);
                break;

            case "2":

                ChooseMeatProcessor.CollectInput(farm);

                break;

            case "3":

                //  ChooseDuckHouse.CollectInput(farm, amount);

                break;

            case "4":

                //  ChooseGrazingField.CollectInput(farm, new Goat(), amount);

                break;

            case "5":


                //    ChooseGrazingField.CollectInput(farm, new Ostrich(), amount);

                break;

            case "6":


                //   ChooseGrazingField.CollectInput(farm, new Pig(), amount);

                break;

            case "7":


                //  ChooseGrazingField.CollectInput(farm, new Sheep(), amount);

                break;

            default:
                Console.WriteLine($"{choice} Is not a valid input!");

                break;
            }
        }
示例#5
0
        public static void ListResources(Farm farm, string id, string type)
        {
            IEnumerable <GrazingField> CorrectFieldEnumerable = from field in farm.GrazingFields
                                                                where field.ShortId == id
                                                                select field;

            List <GrazingField> CorrectFieldList = CorrectFieldEnumerable.ToList();

            GrazingField CorrectField = CorrectFieldList[0];

            IEnumerable <GrazingFieldReport> OrderedAnimals = (from animal in CorrectField.animalsList
                                                               group animal by animal.Type into NewGroup
                                                               select new GrazingFieldReport
            {
                AnimalType = NewGroup.Key,
                Number = NewGroup.Count().ToString()
            }
                                                               );


            List <GrazingFieldReport> AnimalList = OrderedAnimals.ToList();

            int count = 1;

            Console.WriteLine();
            Console.WriteLine("The following is in the Grazing Field:");
            Console.WriteLine();
            foreach (GrazingFieldReport animal in AnimalList)
            {
                Console.WriteLine($"{count}: {animal.Number} {animal.AnimalType}");
                count++;
            }

            Console.WriteLine();
            Console.WriteLine("Which resource should be processed?");
            Console.Write("> ");
            int choice          = Int32.Parse(Console.ReadLine());
            int correctedChoice = choice - 1;

            string AnimalType = AnimalList[correctedChoice].AnimalType;

            Console.WriteLine($"How many {AnimalType} should be processed? (Max 7)");
            int amountToProcess = Int32.Parse(Console.ReadLine());

            if (amountToProcess > 7)
            {
                Console.WriteLine("Learn to read, dumbass");
                amountToProcess = Int32.Parse(Console.ReadLine());
            }
            if (amountToProcess <= 7)
            {
                farm.ProcessingList.Add(new ToProcess
                {
                    FacilityId      = CorrectField.ShortId,
                    Type            = AnimalType,
                    AmountToProcess = amountToProcess
                });

                Console.WriteLine("Ready to process? (Y/n)");
                Console.Write("> ");
                string input = Console.ReadLine();

                switch (input)
                {
                case "Y":
                    break;

                case "n":
                    ChooseMeatProcessor.CollectInput(farm);
                    break;

                default:
                    break;
                }
            }
        }
        public static void ListResources(Farm farm, string id, string type)
        {
            IEnumerable <ChickenHouse> CorrectHouseEnumerable = from house in farm.ChickenHouses
                                                                where house.ShortId == id
                                                                select house;

            List <ChickenHouse> CorrectHouseList = CorrectHouseEnumerable.ToList();

            ChickenHouse CorrectHouse = CorrectHouseList[0];

            IEnumerable <ChickenHouseReport> OrderedChickens = (from chicken in CorrectHouse.animalsList
                                                                group chicken by chicken.Type into NewGroup
                                                                select new ChickenHouseReport
            {
                AnimalType = NewGroup.Key,
                Number = NewGroup.Count().ToString()
            }
                                                                );


            List <ChickenHouseReport> ChickenList = OrderedChickens.ToList();

            int count = 1;

            Console.WriteLine();
            Console.WriteLine("The following is in the Chicken House:");
            Console.WriteLine();
            foreach (ChickenHouseReport chicken in ChickenList)
            {
                Console.WriteLine($"{count}: {chicken.Number} {chicken.AnimalType}");
                count++;
            }

            Console.WriteLine();
            Console.WriteLine("Which resource should be processed?");
            Console.Write("> ");
            int choice          = Int32.Parse(Console.ReadLine());
            int correctedChoice = choice - 1;

            string AnimalType = ChickenList[correctedChoice].AnimalType;

            Console.WriteLine($"How many {AnimalType} should be processed? (Max 7)");
            int amountToProcess = Int32.Parse(Console.ReadLine());

            if (amountToProcess > 7)
            {
                Console.WriteLine("Learn to read, dumbass");
                amountToProcess = Int32.Parse(Console.ReadLine());
            }
            if (amountToProcess <= 5)
            {
                farm.ProcessingList.Add(new ToProcess
                {
                    FacilityId      = CorrectHouse.ShortId,
                    Type            = AnimalType,
                    AmountToProcess = amountToProcess
                });

                Console.WriteLine("Ready to process? (Y/n)");
                Console.Write("> ");
                string input = Console.ReadLine();

                switch (input)
                {
                case "Y":
                    break;

                case "n":
                    ChooseMeatProcessor.CollectInput(farm);
                    break;

                default:
                    break;
                }
            }
        }