public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     Console.WriteLine("Grazing Field has been added");
     Console.WriteLine("Press enter key to continue");
     Console.ReadLine();
 }
예제 #2
0
 //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();
 }
예제 #3
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 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);
 }
예제 #5
0
파일: Farm.cs 프로젝트: jisie/old-macdonald
        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());
        }
예제 #8
0
        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());
        }
예제 #10
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());
        }
예제 #11
0
        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();
     }
 }
예제 #13
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());
        }
예제 #14
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());
        }
예제 #15
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
 }
예제 #16
0
        /*
         *  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);
        }
예제 #17
0
파일: Farm.cs 프로젝트: jisie/old-macdonald
 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);
 }
예제 #19
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     // Confirmation
     System.Console.WriteLine($"{field} has been added");
 }
예제 #20
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     Console.WriteLine("You have added a grazing field!");
 }
예제 #21
0
        /*
         *  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();
        }
예제 #22
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     AvailableGrazingFields.Add(field);
 }
예제 #23
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     Console.WriteLine("Grazing Field Succesfully Created");
     Thread.Sleep(1500);
 }