public static void CollectInput(Farm farm, Sunflower sunflower)
        {
            Console.WriteLine("1. Natural Field");
            Console.WriteLine("2. Plowing Field");
            Console.WriteLine("");
            Console.WriteLine("Where would you like to Place your Sunflower?");

            Console.WriteLine("> ");

            string choice = Console.ReadLine();

            switch (Int32.Parse(choice))
            {
            case 1:
                ChooseNaturalField.CollectInput(farm, sunflower);
                break;

            case 2:
                ChoosePlowingField.CollectInput(farm, sunflower);
                break;

            default:
                break;
            }
        }
示例#2
0
        public static void CollectInput(Farm farm)
        {
            Console.WriteLine("1. Sesame");
            Console.WriteLine("2. Wildflower");
            Console.WriteLine("3. Sunflower");

            Console.WriteLine();
            Console.WriteLine("What are you buying today?");

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

            switch (Int32.Parse(choice))
            {
            case 1:
                ChoosePlowingField.CollectInput(farm, new Sesame());
                break;

            case 2:
                ChooseNaturalField.CollectInput(farm, new Wildflower());
                break;

            case 3:
                //create new method. ChoosePlowedOrNatural
                ChoosePlowingOrNatural.CollectInput(farm, new Sunflower());
                break;

            default:
                break;
            }
        }
示例#3
0
        public static void CollectInput(Farm seed)
        {
            //farm refers to every grazing field

            Console.WriteLine("1. WildFlower");
            Console.WriteLine("2. Sesame");
            Console.WriteLine("3. Sunflower");

            Console.WriteLine();
            Console.WriteLine("What are you buying today?");

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

            switch (Int32.Parse(choice))

            {
            case 1:

                ChooseNaturalField.CollectInput(seed, new Wildflower());
                Console.WriteLine("Wildflowers can only be put in a Natural Field.");

                break;

            case 2:
                ChoosePlowingField.CollectInput(seed, new Sesame());
                break;

            case 3:
                PlaceSunflower.CollectInput(seed, new Sunflower());
                break;

            default:
                break;
            }
        }
示例#4
0
        public static void CollectInput(Farm farm)
        {
            Console.WriteLine("1. Sesame");
            Console.WriteLine("2. Wildflower");
            Console.WriteLine("3. Sunflower");

            Console.WriteLine();
            Console.WriteLine("What are you buying today?");

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

            try
            {
                switch (Int32.Parse(choice))
                {
                case 1:
                    if (farm.PlowingFields.Count >= 1)
                    {
                        ChoosePlowingField.CollectInput(farm, new Sesame());
                    }
                    else
                    {
                        Console.Clear();
                        System.Console.WriteLine("You haven't created a field for this flower yet.");
                        CreateFacility.CollectInput(farm);
                    }
                    break;

                case 2:
                    if (farm.NaturalFields.Count >= 1)
                    {
                        ChooseNaturalField.CollectInput(farm, new Wildflower());
                    }
                    else
                    {
                        Console.Clear();
                        System.Console.WriteLine("You haven't created a field for this flower yet.");
                        CreateFacility.CollectInput(farm);
                    }
                    break;

                case 3:
                {
                    Console.Clear();
                    Console.WriteLine();
                    Console.WriteLine();
                    Console.WriteLine("1. Plowed Field");
                    Console.WriteLine("2. Natural Field");
                    Console.WriteLine();
                    Console.WriteLine("Choose What type of Field to plant your Sunflowers in:");
                    Console.Write("> ");
                    string fieldType = Console.ReadLine();
                    switch (Int32.Parse(fieldType))
                    {
                    case 1:
                        if (farm.PlowingFields.Count >= 1)
                        {
                            ChoosePlowingField.CollectInput(farm, new Sunflower());
                        }
                        else
                        {
                            Console.Clear();
                            System.Console.WriteLine("You haven't created a field for this flower yet.");
                            CreateFacility.CollectInput(farm);
                        }
                        break;

                    case 2:
                        if (farm.NaturalFields.Count >= 1)
                        {
                            ChooseNaturalField.CollectInput(farm, new Sunflower());
                        }
                        else
                        {
                            Console.Clear();
                            System.Console.WriteLine("You haven't created a field for this flower yet.");
                            CreateFacility.CollectInput(farm);
                        }
                        break;

                    default:
                        break;
                    }
                    break;
                }

                default:
                    break;
                }
            }
            catch (FormatException)
            {
                Console.Clear();
                Console.WriteLine();
                Console.WriteLine(@"
                                   .-'`/\
                                 // /' /\`\
    Shucks that didn't work     ('//.-'/`-.;
                                 \ \ / /-.
              __.__.___..__._.___.\\ \\----,_ 
           .:{@&#,&#@&,@&#&&,#&@#&@&\\` \-. .-'-. 
        .:{@#@,#@&#,@#&&#,@&#&@&,&@#&&\\, -._,- \
      .{#@#&@#@#&#&@&#@#@&#,@#@#&@&&#@#\ \// = \`=\__
      `{#@,@#&@&,@&#@,#@&#@#&@#&@,&#@,#/\/ =`-. -_=__
        `:{@#&@&#@&#@&#@,#&&#@&,@#/.'  / / /.-', /
           `:{@#&,#&@#,@&#&@&,@&#/.-// //-'-_= ,/
              `~`~~`~~~`~`~`~~`~( / , /__,___.-
    Sorry for the corny joke...  \ \\/  
                                  `\\\'

");
                Console.WriteLine();
                Console.WriteLine("Please select an available seed option");
                PurchaseSeeds.CollectInput(farm);
            }
        }