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()); } } } }
private static void ShopSellDialog() { string anweisung; while (true) { Console.Clear(); DrawStatusBar(); Console.WriteLine("What do you want to sell? [enter name + index; back]"); Game.GetSeedInventoryInfo(); anweisung = Console.ReadLine(); if (anweisung == "back" || anweisung == "b") { break; } else { try { Seed seedToSell = GetSeedFromUserInput(anweisung); string sellSeed; double price = seedToSell.CalculatePrice(); while (true) { PrintInfoMessage("Do you really want to sell the following seed? It will give you " + price + "$ [yes; no]"); seedToSell.GetInfo(); sellSeed = Console.ReadLine(); if (sellSeed == "yes" || sellSeed == "y") { Game.RemoveSeedFromInventory(seedToSell); Game.Money += price; PrintInfoMessageAndWait("You sold a " + seedToSell.Name + " seed for " + price + "$"); break; } else if (sellSeed == "no" || sellSeed == "n") { break; } } } catch (Exception ex) { PrintInfoMessageAndWait("You dont have that seed!"); } } } }