Esempio n. 1
0
 void AddToSalad(Vegetable v)
 {
     if (salad != null)
     {
         Debug.Log("Added vegetable to salad");
         salad.AddVegetable(v);
     }
     else
     {
         Debug.Log("Something went wrong. Salad is null");
     }
 }
Esempio n. 2
0
    void MakeSalad(Vegetable v)
    {
        //create empty game object
        GameObject g = new GameObject();

        g.transform.SetParent(saladSlot.transform);
        g.transform.localPosition = Vector3.zero;

        salad = g.AddComponent <Salad>();
        salad.AddVegetable(v);

        Debug.Log("Made a salad");
    }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Salad Salad1 = new Salad("Vitamin", new List <IBasicVegetable>());


            var Vegetable1 = new FruitTomato();
            var Vegetable2 = new FruitCucumber();
            var Vegetable3 = new VegetativePekingCabbage();
            var Vegetable4 = new VegetativeCabbage();

            Salad1.AddVegetable(Vegetable1);
            Salad1.AddVegetable(Vegetable2);
            Salad1.AddVegetable(Vegetable3);
            Salad1.AddVegetable(Vegetable4);
            Salad1.DeleteVegetable(Vegetable4);
            Salad1.AddVegetable(Vegetable4);

            int MinSearchByCaloricity = 20;
            int MaxSearchByCaloricity = 100;



            Print(Salad1, MinSearchByCaloricity, MaxSearchByCaloricity);
        }