コード例 #1
0
 public void AddChickenHouse(ChickenHouse field)
 {
     ChickenHouses.Add(field);
     Console.WriteLine("Chicken House has been added");
     Console.WriteLine("Press enter key to continue");
     Console.ReadLine();
 }
コード例 #2
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;
            }
        }
コード例 #3
0
        public override string ToString()
        {
            StringBuilder report = new StringBuilder();

            GrazingFields.ForEach(gf => report.Append(gf));
            DuckHouses.ForEach(dh => report.Append(dh));
            ChickenHouses.ForEach(ch => report.Append(ch));

            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());
        }
コード例 #5
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());
        }
コード例 #6
0
ファイル: Farm.cs プロジェクト: jonizzy113/TrestlebridgeFarms
        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());
        }
コード例 #7
0
        public override string ToString()
        {
            StringBuilder report = new StringBuilder();

            GrazingFields.ForEach(gf => report.Append(gf));

            PlowedFields.ForEach(pf => report.Append(pf));
            ChickenHouses.ForEach(ch => report.Append(ch));
            NaturalFields.ForEach(nf => report.Append(nf));

            DuckHouses.ForEach(dh => report.Append(dh));

            Wildflowers.ForEach(wf => report.Append(wf));

            return(report.ToString());
        }
コード例 #8
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());
        }
コード例 #9
0
 public void AddChickenHouse(ChickenHouse chickenHouse)
 {
     ChickenHouses.Add(chickenHouse);
 }
コード例 #10
0
 public void AddChickenHouse(ChickenHouse house)
 {
     ChickenHouses.Add(house);
 }
コード例 #11
0
 public void AddChickenHouse(ChickenHouse coop)
 {
     ChickenHouses.Add(coop);
 }
コード例 #12
0
 public void AddChickenHouse(ChickenHouse field)
 {
     ChickenHouses.Add(field);
 }
コード例 #13
0
 public void AddChickenHouse(ChickenHouse house)
 {
     ChickenHouses.Add(house);
     Console.WriteLine($"New Chicken House has been created!");
     Console.ReadLine();
 }
コード例 #14
0
 public void AddChickenHouse(ChickenHouse house)
 {
     ChickenHouses.Add(house);
     // Confirmation
     System.Console.WriteLine($"{house} has been added");
 }
コード例 #15
0
ファイル: Farm.cs プロジェクト: jonizzy113/TrestlebridgeFarms
 public void AddChickenHouse(ChickenHouse field)
 {
     ChickenHouses.Add(field);
     Console.WriteLine("Chicken house successfully created");
     Thread.Sleep(1500);
 }
コード例 #16
0
ファイル: Farm.cs プロジェクト: jisie/old-macdonald
 public void AddChickenHouse(ChickenHouse house)
 {
     ChickenHouses.Add(house);
     Console.WriteLine("Chicken House created successfully!");
     Console.WriteLine(ChickenHouses[ChickenHouses.Count - 1]);
 }
コード例 #17
0
 public void AddChickenHouse(ChickenHouse house)
 {
     ChickenHouses.Add(house);
     AvailableChickenHouses.Add(house);
 }
コード例 #18
0
 public void AddChickenHouse(ChickenHouse house)
 {
     ChickenHouses.Add(house);
     Console.WriteLine("You have added a chicken house!");
 }
コード例 #19
0
 public void AddChickenHouse(ChickenHouse house)
 {
     ChickenHouses.Add(house);
     Console.WriteLine("A new chicken house has been created.");
     Thread.Sleep(2000);
 }