private static void HarvestAllDialog(Seed seed)
        {
            string anweisung;

            while (true)
            {
                PrintInfoMessage("Do you really want to harvest all crops? They will be put in your inventory. [yes; no]\r\n\r\n" + seed.GetCropInfo());
                anweisung = Console.ReadLine();

                if (anweisung == "yes" || anweisung == "y")
                {
                    seed.Harvest();
                    PrintInfoMessageAndWait("Crops harvested! They have been placed in your inventory.");
                    break;
                }
                else if (anweisung == "no" || anweisung == "n")
                {
                    break;
                }
            }
        }
        private static void HarvestSelectionDialog(Seed seed)
        {
            string anweisung;

            while (true)
            {
                PrintInfoMessage("Which crop do you want to harvest? [enter comma seperated indexes; back]\r\n\r\n" + seed.GetCropInfo());

                anweisung = Console.ReadLine();
                if (anweisung == "back" || anweisung == "b")
                {
                    break;
                }

                try
                {
                    string[] indexStrings = anweisung.Split(',');
                    int[]    indexes      = Array.ConvertAll(indexStrings, int.Parse);

                    seed.Harvest(indexes);
                    break;
                }
                catch (Exception ex)
                {
                    PrintInfoMessageAndWait(ex.Message);
                }
            }
        }
        private static void HarvestFieldDialog(Seed seed)
        {
            string anweisung;

            while (true)
            {
                PrintInfoMessage("Which crops to you want to harvest [all; selection; back]\r\n\r\n" + seed.GetCropInfo());

                anweisung = Console.ReadLine();
                if (anweisung == "all" || anweisung == "a")
                {
                    HarvestAllDialog(seed);
                    break;
                }
                else if (anweisung == "selection" || anweisung == "s")
                {
                    HarvestSelectionDialog(seed);
                    if (seed.Crops.Count == 0)
                    {
                        break;
                    }
                }
                else if (anweisung == "back" || anweisung == "b")
                {
                    break;
                }
            }
        }
        private static void RemoveSeedDialog(FieldSlot field)
        {
            string remove;

            while (true)
            {
                Console.Clear();
                DrawStatusBar();
                Seed plantedSeed = field.PlantedSeed;
                if (plantedSeed != null)
                {
                    Console.WriteLine("Do you really want to remove the following seed? This kills the seed. [yes; no; more info]");
                    plantedSeed.GetInfo();
                    remove = Console.ReadLine();
                    if (remove == "yes" || remove == "y")
                    {
                        field.RemoveSeed();
                        PrintInfoMessageAndWait("Seed successfully removed.");
                    }
                    else if (remove == "no" || remove == "n")
                    {
                        break;
                    }
                    else if (remove == "more info" || remove == "more" || remove == "m")
                    {
                        PrintInfoMessageAndWait("The seed has the following Crops:\r\n\r\n" + plantedSeed.GetCropInfo());
                    }
                }
            }
        }
예제 #5
0
        private static void HarvestSelectionDialog(Seed seed)
        {
            string anweisung;
              while(true)
              {
            PrintInfoMessage("Which crop do you want to harvest? [enter comma seperated indexes; back]\r\n\r\n" + seed.GetCropInfo());

            anweisung = Console.ReadLine();
            if (anweisung == "back" || anweisung == "b")
              break;

            try
            {
              string[] indexStrings = anweisung.Split(',');
              int[] indexes = Array.ConvertAll(indexStrings, int.Parse);

              seed.Harvest(indexes);
              break;
            }
            catch(Exception ex)
            {
              PrintInfoMessageAndWait(ex.Message);
            }
              }
        }
예제 #6
0
        private static void HarvestFieldDialog(Seed seed)
        {
            string anweisung;
              while (true)
              {
            PrintInfoMessage("Which crops to you want to harvest [all; selection; back]\r\n\r\n" + seed.GetCropInfo());

            anweisung = Console.ReadLine();
            if (anweisung == "all" || anweisung == "a")
            {
              HarvestAllDialog(seed);
              break;
            }
            else if (anweisung == "selection" || anweisung == "s")
            {
              HarvestSelectionDialog(seed);
              if (seed.Crops.Count == 0)
            break;
            }
            else if (anweisung == "back" || anweisung == "b")
              break;

              }
        }
예제 #7
0
        private static void HarvestAllDialog(Seed seed)
        {
            string anweisung;
              while (true)
              {
            PrintInfoMessage("Do you really want to harvest all crops? They will be put in your inventory. [yes; no]\r\n\r\n" + seed.GetCropInfo());
            anweisung = Console.ReadLine();

            if (anweisung == "yes" || anweisung == "y")
            {
              seed.Harvest();
              PrintInfoMessageAndWait("Crops harvested! They have been placed in your inventory.");
              break;
            }
            else if (anweisung == "no" || anweisung == "n")
              break;
              }
        }