예제 #1
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);
     Console.WriteLine("Grazing Field has been added");
     Console.WriteLine("Press enter key to continue");
     Console.ReadLine();
 }
예제 #3
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();
 }
 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 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();
     }
 }
예제 #6
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
 }
예제 #7
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();
        }
예제 #8
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     Console.WriteLine("Grazing Field Succesfully Created");
     Thread.Sleep(1500);
 }
예제 #9
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     AvailableGrazingFields.Add(field);
 }
예제 #10
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     Console.WriteLine("You have added a grazing field!");
 }
예제 #11
0
 public void AddGrazingField(GrazingField field)
 {
     GrazingFields.Add(field);
     // Confirmation
     System.Console.WriteLine($"{field} has been added");
 }
예제 #12
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);
 }
예제 #14
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);
        }