Exemplo n.º 1
0
        public void CreatePlant()
        {
            string name = PromptForValidName <PowerPlant>(Plants, "What is the name of this power plant: ");

            PowerPlant plant = new PowerPlant(name, BuildingType.POWERPLANT);

            Plants.Add(plant);
        }
Exemplo n.º 2
0
        public void TogglePlant()
        {
            string     name  = "";
            PowerPlant plant = null;

            do
            {
                Console.Clear();
                Console.WriteLine("What is the name of the power plant you would like to toggle: ");

                name = Console.ReadLine();
            } while (IsNameAvailable(Plants, name));

            plant = Plants.Where(x => x.Name == name).First();

            ToggleBuilding <PowerPlant>(plant);
        }