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}");
                }
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkMagenta;
            // makes a new instance of the Farm class called Trestlebridge
            Farm
                Trestlebridge = new Farm();

            while (true)
            {
                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();

                if (option == "1")
                {
                    DisplayBanner();
                    CreateFacility.CollectInput(Trestlebridge);
                }
                else if (option == "2")
                {
                    DisplayBanner();
                    PurchaseStock.CollectInput(Trestlebridge);
                }
                else if (option == "3")
                {
                    DisplayBanner();
                    PurchaseSeed.CollectInput(Trestlebridge);
                }
                else if (option == "4")
                {
                    DisplayBanner();
                    Console.WriteLine(Trestlebridge);
                    //  calls the toString method on Trestlebridge

                    Console.WriteLine("Press return key to go back to main menu.");
                    Console.ReadLine();
                }
                else if (option == "5" || option.ToLower() == "exit")
                {
                    Console.WriteLine("Today is a great day for farming");
                    break;
                }
                else
                {
                    Console.WriteLine($"Invalid option: {option}");
                }
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkCyan;

            Farm Trestlebridge = new Farm();

            while (true)
            {
                DisplayBanner();
                //options for user to select action from
                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("> ");
                //this is reading whatever the user selected and then is used below in the conditionals
                string option = Console.ReadLine();

                if (option == "1")
                {
                    DisplayBanner();
                    CreateFacility.CollectInput(Trestlebridge);
                }
                else if (option == "2")
                {
                    DisplayBanner();
                    PurchaseStock.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");
                    // the break exits out of console app
                    break;
                }
                //if user doesn't select any correct options, app alerts them it was incorrect
                else
                {
                    Console.WriteLine($"Invalid option: {option}");
                }
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkMagenta;

            Farm Trestlebridge = new Farm();

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

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

                int option = 0;

                while (option == 0)
                {
                    try
                    {
                        option = Int32.Parse(Console.ReadLine());
                        switch (option)
                        {
                        case 1:
                            DisplayBanner();
                            CreateFacility.CollectInput(Trestlebridge);
                            break;

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

                        case 3:
                            DisplayBanner();
                            PurchaseSeed.CollectInput(Trestlebridge);
                            break;

                        case 4:
                            DisplayBanner();
                            Console.WriteLine("You've hit processing! There's nothing to do here yet... hit enter to return to the main menu.");
                            Console.Read();
                            break;

                        case 5:
                            DisplayBanner();
                            Console.WriteLine(Trestlebridge);
                            Console.WriteLine("\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!");
                            System.Environment.Exit(0);
                            break;

                        default:
                            Console.WriteLine($"Invalid option: {option}. Press enter to return to the main menu.");
                            Console.Read();
                            break;
                        }
                    }
                    catch (FormatException)
                    {
                        Console.WriteLine("Please input a number!");
                    }
                }
            }
        }
Esempio n. 5
0
        // Main method to launch program. Also sets foreground color to white and background to dark blue, harkening a simpler more Commodore 64-esque era.
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkBlue;

            // Creates Trestlebridge object
            Farm Trestlebridge = new Farm();

            // While loop keeps user in FARMS program
            while (true)
            {
                // Displays banner and main menu options to user
                DisplayBanner();
                Console.WriteLine("1. Create Facility");
                Console.WriteLine("2. Purchase Animals");
                Console.WriteLine("3. Purchase Seeds");
                Console.WriteLine("4. Process Farm Products");
                Console.WriteLine("5. Display Farm Status");
                Console.WriteLine("6. Exit");
                Console.WriteLine();

                // Prompts user to select the number of the desired option
                Console.WriteLine("Choose a FARMS option");
                Console.Write("> ");
                string option = Console.ReadLine();

                // Reads user's input and presents the associated sub-menu for the chosen option
                if (option == "1")
                {
                    DisplayBanner();
                    CreateFacility.CollectInput(Trestlebridge);
                }
                else if (option == "2")
                {
                    DisplayBanner();
                    PurchaseStock.CollectInput(Trestlebridge);
                }
                else if (option == "3")
                {
                    DisplayBanner();
                    PurchaseSeed.CollectInput(Trestlebridge);
                }
                else if (option == "4")
                {
                    DisplayBanner();
                    ChooseProcessingOption.CollectInput(Trestlebridge);
                }

                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();
                }

                // Exits program and prints a warm departure message to the user
                else if (option == "6")
                {
                    Console.WriteLine("Rest well. Tomorrow brings another day of plowing fields and ethically raising happy animals for farm-to-table restaurants all over Nashville.");
                    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;
                }
            }
        }
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkBlue;

            Farm Trestlebridge = new Farm();

            while (true)
            {
                DisplayBanner();
                Console.WriteLine("1. Create Facility");
                Console.WriteLine("2. Purchase Animals");
                Console.WriteLine("3. Purchase Seeds");
                Console.WriteLine("4. Process Resource");
                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();
                    PurchasePlants.CollectInput(Trestlebridge);
                }
                else if (option == "4")
                {
                    DisplayBanner();
                    ProcessResource.CollectInput(Trestlebridge);
                }
                else if (option == "5")
                {
                    DisplayBanner();
                    Console.WriteLine(Trestlebridge);
                    Console.WriteLine("\n\n\n");
                }
                else if (option == "6")
                {
                    Console.WriteLine("Today is a great day for farming");
                    break;
                }
                else
                {
                    Console.WriteLine($"Invalid option: {option}");
                }
                Console.WriteLine();
                Console.Write("Press Enter To Return To Main Menu");
                Console.ReadLine();
            }
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            //color of the application
            //such an eyesore
            //who the hell though this was a good idea???
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkMagenta;


            //instance of a new farm type
            Farm Trestlebridge = new Farm();

            //main menu
            while (true)
            {
                DisplayBanner();

                //list of options
                //added the option for processing options menu on option 5
                //changed exit to option 6
                Console.WriteLine("1. Create Facility");
                Console.WriteLine("2. Purchase Animals");
                Console.WriteLine("3. Purchase Seeds");
                Console.WriteLine("4. Display Farm Status");
                Console.WriteLine("5. Processing Options");
                Console.WriteLine("6. Exit");

                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();
                    PurchaseSeed.CollectInput(Trestlebridge);
                }
                else if (option == "4")
                {
                    DisplayBanner();
                    //Calls the ToString() function in Farm.cs. This sets off a cascade of calling multiple ToString() functions
                    Console.WriteLine(Trestlebridge);
                    Console.WriteLine("\n\n\n");
                    Console.WriteLine("Press return key to go back to main menu.");
                    Console.ReadLine();
                }
                //this will bring you to the processing options menu
                else if (option == "5")
                {
                    //calls the display banner method
                    DisplayBanner();
                    //calls the collect input method from ProcessingOptions.cs
                    ProcessingOptions.CollectInput();
                }
                else if (option == "6")
                {
                    Console.WriteLine("Today is a great day for farming");
                    break;
                }
                else
                {
                    //this will tell you that whatever key you hit was invalid
                    Console.WriteLine($"Invalid option: {option}");
                    //this pauses the error message
                    Thread.Sleep(2000);
                }
            }
        }
Esempio n. 9
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkMagenta;

            Farm Trestlebridge = new Farm();

            while (true)
            {
                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();

                if (InputWasInvalid)
                {
                    Console.WriteLine("Input was invalid, please try again.");
                }
                Console.WriteLine("Choose a FARMS option");
                Console.Write("> ");
                string option = Console.ReadLine();

                if (option == "1")
                {
                    DisplayBanner();
                    InputWasInvalid = false;
                    CreateFacility.CollectInput(Trestlebridge);
                }
                else if (option == "2")
                {
                    DisplayBanner();
                    InputWasInvalid = false;
                    PurchaseStock.CollectInput(Trestlebridge);
                }
                else if (option == "3")
                {
                    DisplayBanner();
                    PurchaseSeed.CollectInput(Trestlebridge);
                }
                else if (option == "4")
                {
                    DisplayBanner();
                    InputWasInvalid = false;
                    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
                {
                    InputWasInvalid = true;
                }
            }
        }
Esempio n. 10
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.DarkCyan;

            Farm Trestlebridge = new Farm();

            while (true)
            {
                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();

                if (option == "1")
                {
                    DisplayBanner();
                    CreateFacility.CollectInput(Trestlebridge);
                }
                else if (option == "2")
                {
                    DisplayBanner();
                    PurchaseStock.CollectInput(Trestlebridge);
                }
                else if (option == "3")
                {
                    DisplayBanner();
                    PurchaseSeed.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.Clear();
                    Console.WriteLine("\n\n\n");
                    Console.WriteLine("Today is a great day for farming. May you drown in the great Kraken's infinite love.");
                    Console.WriteLine(@"              
                 7... 7                 
              77.......7                
             7...........               
             .............7             
           I...............:7           
           .................            
  777       ...............7       7    
 7.I~.7      7...........7      7.~7.7  
 77  .,       ...........       ,.      
     .7       ...........       7.7     
    ..7       ...........        ..     
   7.7        ...........        7.     
  7=.         ...........        7..    
   ..  7      7:........         7..    
   I...~..7    .,......,    7..:...,    
  7...77 7.    +.......,    .   7...7   
  :. ...77  7 I.........I7  777...7.,   
  .. 7~.........................~7 ..   
  7.77 777++7......7......7?=77   7.7   
   7..7   7........7........    7..+    
     ?......7+..7..7..7..+7......?      
           7+.., .. ..77..+7            
          7=... 7.. .. 7....            
          ..+..  ..7..7 ,.+..7          
        7..I~.7 7..7..7 7.~7..7         
      7...  ..7 +.? ?.= 7..  ...7       
    I..+    ,.7 ..   .. 7.,7  77..I     
   ..77     I.7 ..   .. 7.I      7..7   
  ,.7       7.: ..  7..7:.        7..   
 7.=7 7.7~.77....     .... 7.:7.   7.7  
 7.       .?  ...     ...7 7.7     7.7  
 7.77    7.7  ..7      .. 77.      7.7  
  ..7  77..   ..7     7..7  ..7   7..   
   :.....77  ~.?.     .7.:   7......7   
             ..77    777..              
             :.7       7.:              
             7.7       7.7              
              .:       7.7              
              ..       ..7              
              7.7      .7               
               .7    77.7               
                .    7.7                
               7,7   7.7                
                 .7  .                   
                         GlassGiant.com
                    ");
                    break;
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine("\n\n\n");
                    Console.WriteLine("Welcome to timeout.");
                    Console.WriteLine("Your mom and I are very disappointed.");
                    Console.WriteLine();
                    Console.WriteLine($"Invalid option: {option}");
                    Console.ReadLine();
                }
            }
        }
Esempio n. 11
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}");
                }
            }
        }