Esempio n. 1
0
    public void OnSow(SowPlant2Type Sow)
    {
        SowingData = Sow;

        // Go through all our children and find all organs.
        Organs.Clear();
        foreach (object ChildObject in My.ChildrenAsObjects)
        {
            Organ Child = ChildObject as Organ;
            if (Child != null)
            {
                Organs.Add(Child);
            }
        }

        if (NewCrop != null)
        {
            NewCropType Crop = new NewCropType();
            Crop.crop_type = CropType;
            Crop.sender    = Name;
            NewCrop.Invoke(Crop);
        }

        if (Sowing != null)
        {
            Sowing.Invoke();
        }

        // tell all our children about sow
        foreach (Organ Child in Organs)
        {
            Child.OnSow(Sow);
        }
    }