コード例 #1
0
 public bool HasActiveObjective <T>() where T : AIObjective => CurrentObjective is T || CurrentObjective != null && CurrentObjective.GetSubObjectivesRecursive().Any(so => so is T);
コード例 #2
0
 /// <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;