public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); Console.WriteLine("Grazing Field has been added"); Console.WriteLine("Press enter key to continue"); Console.ReadLine(); }
//Adds Grazing field when purchasing new facility. public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); Console.WriteLine("Grazing Field Added"); Console.WriteLine("Press enter to return to Main Menu"); Console.ReadLine(); }
public void AddFacility(object facility) { switch (facility) { case ChickenHouse C: ChickenHouses.Add(C); break; case DuckHouse D: DuckHouses.Add(D); break; case PlowedField P: PlowedFields.Add(P); break; case GrazingField G: GrazingFields.Add(G); break; case NaturalField N: NaturalFields.Add(N); break; } }
public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); // Added the Console.WriteLine and added a 2 second delay before showing the main menu. Console.WriteLine("A new grazing field has been created."); Thread.Sleep(2000); }
public override string ToString() { StringBuilder report = new StringBuilder(); GrazingFields.ForEach(gf => report.Append(gf)); return(report.ToString()); }
public override string ToString() { StringBuilder report = new StringBuilder(); GrazingFields.ForEach(gf => report.Append(gf)); NaturalFields.ForEach(nf => report.Append(nf)); PlowedFields.ForEach(pf => report.Append(pf)); return(report.ToString()); }
public override string ToString() { StringBuilder report = new StringBuilder(); DuckHouses.ForEach(dh => report.Append(dh)); GrazingFields.ForEach(gf => report.Append(gf)); PlowedFields.ForEach(pf => report.Append(pf)); return(report.ToString()); }
public override string ToString() { StringBuilder report = new StringBuilder(); GrazingFields.ForEach(gf => report.Append(gf)); PlowFields.ForEach(pf => report.Append(pf)); NaturalFields.ForEach(nf => report.Append(nf)); ChickenHouses.ForEach(ch => report.Append(ch)); DuckHouses.ForEach(dh => report.Append(dh)); return(report.ToString()); }
public override string ToString() { //Creates a new string StringBuilder report = new StringBuilder(); //Goes through every Facility in the part and calls its ToString() function, adding it to the report string GrazingFields.ForEach(gf => report.Append(gf)); PlowedFields.ForEach(gf => report.Append(gf)); NaturalFields.ForEach(gf => report.Append(gf)); ChickenHouses.ForEach(gf => report.Append(gf)); DuckHouses.ForEach(gf => report.Append(gf)); //Returns the report string return(report.ToString()); }
public override string ToString() { StringBuilder report = new StringBuilder(); GrazingFields.ForEach(f => report.Append(f)); ChickenHouses.ForEach(f => report.Append(f)); DuckHouses.ForEach(f => report.Append(f)); PlowedFields.ForEach(f => report.Append(f)); NaturalFields.ForEach(f => report.Append(f)); report.Append($"Total Seeds in storage is {processedSeeds}.\n"); report.Append($"Total Compost in storage is {processedCompost}.\n"); return(report.ToString()); }
public override string ToString() { StringBuilder report = new StringBuilder(); GrazingFields.ForEach(gf => report.Append(gf)); PlowedFields.ForEach(gf => report.Append(gf)); ChickenHouses.ForEach(gf => report.Append(gf)); DuckFarms.ForEach(gf => report.Append(gf)); NaturalFields.ForEach(gf => report.Append(gf)); return(report.ToString()); }
public void AddGrazingField(GrazingField field) { try { GrazingFields.Add(field); //Ticket #19 Console.WriteLine("A new grazing field has been created!"); Console.WriteLine("Press enter to continue."); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine("Could not add a grazing field."); Console.WriteLine("Press enter to continue."); Console.ReadLine(); } }
public override string ToString() { StringBuilder report = new StringBuilder(); GrazingFields.ForEach(gf => report.Append(gf)); PlowedFields.ForEach(pf => report.Append(pf)); NaturalFields.ForEach(nf => report.Append(nf)); DuckHouses.ForEach(dh => report.Append(dh)); ChickenHouses.ForEach(ch => report.Append(ch)); report.Append("\n"); report.Append(SeedHarvester); report.Append(MeatProcessor); report.Append(FeatherGatherer); report.Append(EggGatherer); report.Append(Composter); return(report.ToString()); }
public override string ToString() { double TotalMeat = 0; foreach (GrazingField gf in GrazingFields) { TotalMeat += gf.Meat; } StringBuilder report = new StringBuilder(); GrazingFields.ForEach(gf => report.Append(gf)); ChickenHouses.ForEach(ch => report.Append(ch)); DuckHouses.ForEach(dh => report.Append(dh)); NaturalFields.ForEach(dh => report.Append(dh)); PlowedFields.ForEach(dh => report.Append(dh)); report.Append($"Total Meat Produced: {TotalMeat}kg"); return(report.ToString()); }
public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); }
/* * This method must specify the correct product interface of the * resource being purchased. */ // public void PurchaseResource<T> (IResource resource, int index) // { // Console.WriteLine(typeof(T).ToString()); // switch (typeof(T).ToString()) // { // case "Cow": // GrazingFields[index].AddResource((IGrazing)resource); // break; // default: // break; // } // } public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); Console.WriteLine("You have added a Grazing Field!"); Thread.Sleep(1000); }
public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); Console.WriteLine("Grazing Field created successfully!"); Console.WriteLine(GrazingFields[GrazingFields.Count - 1]); }
public void AddGrazingField(GrazingField grazingField) { GrazingFields.Add(grazingField); }
public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); // Confirmation System.Console.WriteLine($"{field} has been added"); }
public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); Console.WriteLine("You have added a grazing field!"); }
/* * This method must specify the correct product interface of the * resource being purchased. */ //will be used in the future to add generic resources // public void PurchaseResource<T>(IResource resource, int index) // { // Console.WriteLine(typeof(T).ToString()); // switch (typeof(T).ToString()) // { // case "Cow": // GrazingFields[index].AddResource((IGrazing)resource); // break; // default: // break; // } // } public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); Console.WriteLine($"New field has been created!"); Console.ReadLine(); }
public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); AvailableGrazingFields.Add(field); }
public void AddGrazingField(GrazingField field) { GrazingFields.Add(field); Console.WriteLine("Grazing Field Succesfully Created"); Thread.Sleep(1500); }