static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkMagenta;

            Farm Trestlebridge = new Farm();

            while (true)
            {
                // Main menu displayed
                DisplayBanner();
                Console.WriteLine("1. Create Facility");
                Console.WriteLine("2. Purchase Animals");
                Console.WriteLine("3. Purchase Seeds");
                Console.WriteLine("4. Display Farm Status");
                Console.WriteLine("5. Exit");
                Console.WriteLine();

                Console.WriteLine("Choose a FARMS option");
                Console.Write("> ");
                string option = Console.ReadLine();

                // Collecting user input from menu
                if (option == "1")
                {
                    DisplayBanner();
                    CreateFacility.CollectInput(Trestlebridge);
                }
                else if (option == "2")
                {
                    DisplayBanner();
                    PurchaseStock.CollectInput(Trestlebridge);
                }
                else if (option == "3")
                {
                    DisplayBanner();
                    PurchaseSeeds.CollectInput(Trestlebridge);
                }
                else if (option == "4")
                {
                    DisplayBanner();
                    Console.WriteLine(Trestlebridge);
                    Console.WriteLine("\n\n\n");
                    Console.WriteLine("Press return key to go back to main menu.");
                    Console.ReadLine();
                }
                else if (option == "5")
                {
                    Console.WriteLine("Today is a great day for farming");
                    break;
                }
                else
                {
                    Console.WriteLine($"Invalid option: {option}");
                }
            }
        }
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkMagenta;

            Farm Trestlebridge = new Farm();


            bool flag = true;

            while (flag)
            {
                DisplayBanner();
                Console.WriteLine("1. Create Facility");
                Console.WriteLine("2. Purchase Animals");
                Console.WriteLine("3. Purchase Seeds");
                Console.WriteLine("4. Processing");
                Console.WriteLine("5. Display Farm Status");
                Console.WriteLine("6. Exit");
                Console.WriteLine();

                Console.WriteLine("Choose a FARMS option");
                Console.Write("> ");
                string option = Console.ReadLine();

                switch (option)
                {
                case "1":
                    DisplayBanner();
                    CreateFacility.CollectInput(Trestlebridge);
                    break;

                case "2":
                    DisplayBanner();
                    PurchaseStock.CollectInput(Trestlebridge);
                    break;

                case "3":
                    DisplayBanner();
                    PurchaseSeeds.CollectInput(Trestlebridge);
                    break;

                case "4":
                    DisplayBanner();
                    ProcessingOptions.CollectInput(Trestlebridge);
                    break;

                case "5":
                    DisplayBanner();
                    Console.WriteLine(Trestlebridge);
                    Console.WriteLine("\n\n\n\n");
                    Console.WriteLine("Press return key to go back to main menu.");
                    Console.ReadLine();
                    break;

                case "6":
                    Console.WriteLine("Today is a great day for farming");
                    flag = false;
                    break;

                default:
                    Console.WriteLine($"{option} Is not a valid input");
                    break;
                }
            }
        }
示例#3
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.DarkMagenta;
            Console.BackgroundColor = ConsoleColor.Gray;

            Farm Trestlebridge = new Farm();

            // Trestlebridge.ChickenHouses.Add(new ChickenHouse());

            // Trestlebridge.ChickenHouses[0].AddResource(new Chicken());
            // Trestlebridge.ChickenHouses[0].AddResource(new Chicken());
            // Trestlebridge.ChickenHouses[0].AddResource(new Chicken());
            // Trestlebridge.ChickenHouses[0].AddResource(new Chicken());
            // Trestlebridge.ChickenHouses[0].AddResource(new Chicken());
            // Trestlebridge.ChickenHouses[0].AddResource(new Chicken());
            // Trestlebridge.ChickenHouses[0].AddResource(new Chicken());
            // Trestlebridge.ChickenHouses[0].AddResource(new Chicken());

            while (true)
            {
                DisplayBanner();
                Console.WriteLine("1. Create Facility");
                Console.WriteLine("2. Purchase Animals");
                Console.WriteLine("3. Purchase Seeds");
                Console.WriteLine("4. Process Resources");
                Console.WriteLine("5. Display Farm Status");
                Console.WriteLine("6. Exit");
                Console.WriteLine();

                Console.WriteLine("Choose a FARMS option");
                Console.Write("> ");
                string option = Console.ReadLine();

                if (option == "1")
                {
                    DisplayBanner();
                    CreateFacility.CollectInput(Trestlebridge);
                }
                else if (option == "2")
                {
                    DisplayBanner();
                    PurchaseStock.CollectInput(Trestlebridge);
                }
                else if (option == "3")
                {
                    DisplayBanner();
                    PurchaseSeeds.CollectInput(Trestlebridge);
                }
                else if (option == "4")
                {
                    DisplayBanner();
                    ChooseMeatFacility.CollectInput(Trestlebridge, new MeatProcessor());
                }
                else if (option == "5")
                {
                    DisplayBanner();
                    Console.WriteLine(Trestlebridge);
                    Console.WriteLine("\n\n\n");
                    Console.WriteLine("Press return key to go back to main menu.");
                    Console.ReadLine();
                }
                else if (option == "6")
                {
                    Console.WriteLine("Today is a great day for farming");
                    break;
                }
                else
                {
                    Console.WriteLine($"Invalid option: {option}");
                }
            }
        }