/// <summary> /// Is asked for information such that another lifeform can decided if this lifeform is food or not. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void IsPossiblePreyEventHandler(object sender, ControlEvents.GetPossiblePreyEventArgs e) { //delegate. Send back location, ID and species. if (e.SenderID != ID) { (Vector PreyLocation, string PreyID, string PreySpeices)preyInformation = (Location, ID, Species); e.AddPreyInformation(preyInformation); } }
protected List <(Vector PreyLocation, string PreyID, string PreySpecies)> OnGetPossiblePreys(ControlEvents.GetPossiblePreyEventArgs e) { getPossiblePreyEventHandler eventHandler = RaiseFindPreyEvent; if (eventHandler != null) { eventHandler.Invoke(this, e); return(e.GetPossiblePreys()); } return(null); }