protected List <(string mateID, Vector Location)> OnPossibleMates(ControlEvents.PossibleMateEventArgs e) { possibleMatesEventHandler eventHandler = RaisePossibleMatesEvent; if (eventHandler != null) { eventHandler.Invoke(this, e); return(e.GetPossibleMates()); } return(null); }
/// <summary> /// Is asked about whether it is a possible mate for another plant or not. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void CanMateEventHandler(object sender, ControlEvents.PossibleMateEventArgs e) { if (e.SenderID != ID) { if (mateID == null) { if (e.Information.Species == Species) { if (e.Information.Gender != Gender) { if (TimeToReproductionNeed <= 0) { if (Age >= ReproductionAge) { e.AddMateInformation((ID, Location)); } } } } } } }