Пример #1
0
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
     Console.WriteLine("Natural Field Added");
     Console.WriteLine("Press enter to return to Main Menu");
     Console.ReadLine();
 }
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
     Console.WriteLine("Natural Field has been added");
     Console.WriteLine("Press enter key to continue");
     Console.ReadLine();
 }
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
     PlantFields.Add(field);
     Console.WriteLine("A new natural field has been created.");
     Thread.Sleep(2000);
 }
Пример #4
0
        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 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();

            GrazingFields.ForEach(gf => report.Append(gf));
            NaturalFields.ForEach(nf => report.Append(nf));
            PlowedFields.ForEach(pf => report.Append(pf));
            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());
        }
Пример #8
0
        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 void PlantSeedInChosenField(ISeedAndCompost seed, int index)
        {
            switch (NaturalAndPlowed[index].TypeString())
            {
            case "Plowed":
                PlowedFields.Find(field => field == NaturalAndPlowed[index]).AddResource((IPlowed)seed);
                break;

            case "Natural":
                NaturalFields.Find(field => field == NaturalAndPlowed[index]).AddResource((INatural)seed);
                break;

            default:
                break;
            }
        }
 public void AddNaturalField(NaturalField field)
 {
     try
     {
         NaturalFields.Add(field);
         //Ticket #29
         Console.WriteLine("A new natural field has been created!");
         Console.WriteLine("Press enter to continue.");
         Console.ReadLine();
     }
     catch (Exception ex)
     {
         Console.WriteLine("Could not add a natural field.");
         Console.WriteLine("Press enter to continue.");
         Console.ReadLine();
     }
 }
Пример #11
0
        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());
        }
Пример #12
0
        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());
        }
Пример #13
0
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
 }
Пример #14
0
 public void AddNaturalField(NaturalField plant)
 {
     NaturalFields.Add(plant);
 }
Пример #15
0
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
     Console.WriteLine($"New Natural Field has been created!");
     Console.ReadLine();
 }
Пример #16
0
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
     NaturalAndPlowed.Add(field);
 }
Пример #17
0
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
     Console.WriteLine("You have added a Natural field!");
 }
 public void AddNaturalField(NaturalField naturalField)
 {
     NaturalFields.Add(naturalField);
 }
Пример #19
0
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
     Console.WriteLine("Natural Field successfully created");
     Thread.Sleep(1500);
 }
Пример #20
0
 public void AddNaturalField(NaturalField field)
 {
     NaturalFields.Add(field);
     AvailableNaturalFields.Add(field);
 }