public bool HasActiveObjective <T>() where T : AIObjective => CurrentObjective is T || CurrentObjective != null && CurrentObjective.GetSubObjectivesRecursive().Any(so => so is T);
/// <summary> /// Returns the last active objective of the specific type. /// </summary> public T GetActiveObjective <T>() where T : AIObjective => CurrentObjective?.GetSubObjectivesRecursive(includingSelf : true).LastOrDefault(so => so is T) as T;