Barotrauma Client Doc
Barotrauma.AIObjectiveLoop< T > Class Template Referenceabstract
Inheritance diagram for Barotrauma.AIObjectiveLoop< T >:
Barotrauma.AIObjective

Public Member Functions

bool AddTarget (T target)
 
 AIObjectiveLoop (Character character, AIObjectiveManager objectiveManager, float priorityModifier, Identifier option=default)
 
override void Update (float deltaTime)
 
override void Reset ()
 
- Public Member Functions inherited from Barotrauma.AIObjective
IEnumerable< AIObjectiveGetSubObjectivesRecursive (bool includingSelf=false)
 
AIObjective GetActiveObjective ()
 
 AIObjective (Character character, AIObjectiveManager objectiveManager, float priorityModifier, Identifier option=default)
 
void TryComplete (float deltaTime)
 Makes the character act according to the objective, or according to any subobjectives that need to be completed before this one More...
 
void AddSubObjective (AIObjective objective, bool addFirst=false)
 
void RemoveSubObjective< T > (ref T objective)
 
void SortSubObjectives ()
 
bool IsIgnoredAtOutpost ()
 Returns true only when at a friendly outpost and when the order is set to be ignored there. Note that even if this returns false, the objective can be disallowed, because AllowInFriendlySubs is false. More...
 
float CalculatePriority ()
 Call this only when the priority needs to be recalculated. Use the cached Priority property when you don't need to recalculate. More...
 
virtual bool IsDuplicate< T > (T otherObjective)
 
virtual void OnSelected ()
 
virtual void OnDeselected ()
 
virtual void SpeakAfterOrderReceived ()
 
Sprite GetSprite ()
 

Protected Member Functions

override void Act (float deltaTime)
 
override bool CheckObjectiveSpecific ()
 
override float GetPriority ()
 
void UpdateTargets ()
 
virtual void FindTargets ()
 
virtual void CreateObjectives ()
 
abstract void OnObjectiveCompleted (AIObjective objective, T target)
 
abstract IEnumerable< T > GetList ()
 List of all possible items of the specified type. Used for filtering the removed objectives. More...
 
abstract float TargetEvaluation ()
 
abstract AIObjective ObjectiveConstructor (T target)
 
abstract bool Filter (T target)
 
- Protected Member Functions inherited from Barotrauma.AIObjective
void HandleNonAllowed ()
 
void SyncRemovedObjectives< T1, T2 > (Dictionary< T1, T2 > dictionary, IEnumerable< T1 > collection)
 Checks if the subobjectives in the given collection are removed from the subobjectives. And if so, removes it also from the dictionary. More...
 
bool TryAddSubObjective< T > (ref T objective, Func< T > constructor, Action onCompleted=null, Action onAbandon=null)
 Checks if the objective already is created and added in subobjectives. If not, creates it. Handles objectives that cannot be completed. If the objective has been removed form the subobjectives, a null value is assigned to the reference. Returns true if the objective was created and successfully added. More...
 
virtual void OnCompleted ()
 
virtual void OnAbandon ()
 
bool CanEquip (Item item, bool allowWearing)
 

Protected Attributes

HashSet< T > ignoreList = new HashSet<T>()
 
float targetUpdateTimer
 
- Protected Attributes inherited from Barotrauma.AIObjective
readonly List< AIObjectivesubObjectives = new List<AIObjective>()
 

Properties

HashSet< T > Targets = new HashSet<T>() [get]
 
Dictionary< T, AIObjectiveObjectives = new Dictionary<T, AIObjective>() [get]
 
virtual float TargetUpdateTimeMultiplier = 1 [get]
 
virtual float IgnoreListClearInterval [get]
 
HashSet< T > ReportedTargets = new HashSet<T>() [get]
 
override bool CanBeCompleted [get]
 
override bool AbandonWhenCannotCompleteSubjectives [get]
 
override bool AllowSubObjectiveSorting [get]
 
override bool AllowWhileHandcuffed [get]
 
virtual bool InverseTargetEvaluation [get]
 
virtual bool ResetWhenClearingIgnoreList [get]
 
virtual bool ForceOrderPriority [get]
 
virtual int MaxTargets [get]
 
override bool IsLoop [get, set]
 
- Properties inherited from Barotrauma.AIObjective
virtual float Devotion [get]
 
abstract Identifier Identifier [get, set]
 
virtual string DebugTag [get]
 
virtual bool ForceRun [get]
 
virtual bool IgnoreUnsafeHulls [get]
 
virtual bool AbandonWhenCannotCompleteSubjectives [get]
 
virtual bool AllowSubObjectiveSorting [get]
 
virtual bool PrioritizeIfSubObjectivesActive [get]
 
virtual bool AllowMultipleInstances [get]
 Can there be multiple objective instaces of the same type? More...
 
virtual bool ConcurrentObjectives [get]
 Run the main objective with all subobjectives concurrently? If false, the main objective will continue only when all the subobjectives have been removed (done). More...
 
virtual bool KeepDivingGearOn [get]
 
virtual bool KeepDivingGearOnAlsoWhenInactive [get]
 
virtual bool AllowAutomaticItemUnequipping [get]
 There's a separate property for diving suit and mask: KeepDivingGearOn. More...
 
virtual bool AllowOutsideSubmarine [get]
 
virtual bool AllowInFriendlySubs [get]
 
virtual bool AllowInAnySub [get]
 
virtual bool AllowWhileHandcuffed [get]
 
float CumulatedDevotion [get, set]
 
virtual float MaxDevotion [get]
 
float Priority [get, set]
 Final priority value after all calculations. More...
 
float BasePriority [get, set]
 
float PriorityModifier = 1 [get]
 
bool ForceHighestPriority [get, set]
 
bool ForceWalk [get, set]
 
bool IgnoreAtOutpost [get, set]
 
bool Abandon [get, set]
 
virtual bool CanBeCompleted [get]
 
virtual bool IsLoop [get, set]
 When true, the objective is never completed, unless CanBeCompleted returns false. More...
 
IEnumerable< AIObjectiveSubObjectives [get]
 
AIObjective CurrentSubObjective [get]
 
HumanAIController HumanAIController [get]
 
IndoorsSteeringManager PathSteering [get]
 
SteeringManager SteeringManager [get]
 
bool IsAllowed [get]
 
bool IsCompleted [get, protected set]
 
static Color ObjectiveIconColor [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Barotrauma.AIObjective
static Sprite GetSprite (Identifier identifier, Identifier option, Entity targetEntity)
 
- Public Attributes inherited from Barotrauma.AIObjective
readonly Character character
 
readonly AIObjectiveManager objectiveManager
 
readonly Identifier Option
 
Func< AIObjective, bool > AbortCondition
 Aborts the objective when this condition is true. More...
 
- Static Protected Member Functions inherited from Barotrauma.AIObjective
static bool CanEquip (Character character, Item item, bool allowWearing)
 
- Events inherited from Barotrauma.AIObjective
Action Completed
 A single shot event. Automatically cleared after launching. Use OnCompleted method for implementing (internal) persistent behavior. More...
 
Action Abandoned
 A single shot event. Automatically cleared after launching. Use OnAbandoned method for implementing (internal) persistent behavior. More...
 
Action Selected
 A single shot event. Automatically cleared after launching. Use OnSelected method for implementing (internal) persistent behavior. More...
 
Action Deselected
 A single shot event. Automatically cleared after launching. Use OnDeselected method for implementing (internal) persistent behavior. More...
 

Detailed Description

Definition at line 7 of file AIObjectiveLoop.cs.

Constructor & Destructor Documentation

◆ AIObjectiveLoop()

Barotrauma.AIObjectiveLoop< T >.AIObjectiveLoop ( Character  character,
AIObjectiveManager  objectiveManager,
float  priorityModifier,
Identifier  option = default 
)

Definition at line 39 of file AIObjectiveLoop.cs.

Member Function Documentation

◆ Act()

override void Barotrauma.AIObjectiveLoop< T >.Act ( float  deltaTime)
protectedvirtual

Implements Barotrauma.AIObjective.

Definition at line 42 of file AIObjectiveLoop.cs.

◆ AddTarget()

bool Barotrauma.AIObjectiveLoop< T >.AddTarget ( target)

Definition at line 24 of file AIObjectiveLoop.cs.

◆ CheckObjectiveSpecific()

override bool Barotrauma.AIObjectiveLoop< T >.CheckObjectiveSpecific ( )
protectedvirtual

◆ CreateObjectives()

virtual void Barotrauma.AIObjectiveLoop< T >.CreateObjectives ( )
protectedvirtual

Reimplemented in Barotrauma.AIObjectiveRepairItems.

Definition at line 196 of file AIObjectiveLoop.cs.

◆ Filter()

abstract bool Barotrauma.AIObjectiveLoop< T >.Filter ( target)
protectedpure virtual

◆ FindTargets()

virtual void Barotrauma.AIObjectiveLoop< T >.FindTargets ( )
protectedvirtual

Reimplemented in Barotrauma.AIObjectivePumpWater.

Definition at line 173 of file AIObjectiveLoop.cs.

◆ GetList()

◆ GetPriority()

override float Barotrauma.AIObjectiveLoop< T >.GetPriority ( )
protectedvirtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 118 of file AIObjectiveLoop.cs.

◆ ObjectiveConstructor()

abstract AIObjective Barotrauma.AIObjectiveLoop< T >.ObjectiveConstructor ( target)
protectedpure virtual

◆ OnObjectiveCompleted()

abstract void Barotrauma.AIObjectiveLoop< T >.OnObjectiveCompleted ( AIObjective  objective,
target 
)
protectedpure virtual

◆ Reset()

override void Barotrauma.AIObjectiveLoop< T >.Reset ( )
virtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 110 of file AIObjectiveLoop.cs.

◆ TargetEvaluation()

◆ Update()

override void Barotrauma.AIObjectiveLoop< T >.Update ( float  deltaTime)
virtual

Reimplemented from Barotrauma.AIObjective.

Definition at line 57 of file AIObjectiveLoop.cs.

◆ UpdateTargets()

void Barotrauma.AIObjectiveLoop< T >.UpdateTargets ( )
protected

Definition at line 165 of file AIObjectiveLoop.cs.

Member Data Documentation

◆ ignoreList

HashSet<T> Barotrauma.AIObjectiveLoop< T >.ignoreList = new HashSet<T>()
protected

Definition at line 11 of file AIObjectiveLoop.cs.

◆ targetUpdateTimer

float Barotrauma.AIObjectiveLoop< T >.targetUpdateTimer
protected

Definition at line 13 of file AIObjectiveLoop.cs.

Property Documentation

◆ AbandonWhenCannotCompleteSubjectives

override bool Barotrauma.AIObjectiveLoop< T >.AbandonWhenCannotCompleteSubjectives
get

Definition at line 45 of file AIObjectiveLoop.cs.

◆ AllowSubObjectiveSorting

override bool Barotrauma.AIObjectiveLoop< T >.AllowSubObjectiveSorting
get

Definition at line 46 of file AIObjectiveLoop.cs.

◆ AllowWhileHandcuffed

override bool Barotrauma.AIObjectiveLoop< T >.AllowWhileHandcuffed
get

Definition at line 47 of file AIObjectiveLoop.cs.

◆ CanBeCompleted

override bool Barotrauma.AIObjectiveLoop< T >.CanBeCompleted
get

Definition at line 44 of file AIObjectiveLoop.cs.

◆ ForceOrderPriority

virtual bool Barotrauma.AIObjectiveLoop< T >.ForceOrderPriority
getprotected

Definition at line 51 of file AIObjectiveLoop.cs.

◆ IgnoreListClearInterval

virtual float Barotrauma.AIObjectiveLoop< T >.IgnoreListClearInterval
getprotected

Definition at line 20 of file AIObjectiveLoop.cs.

◆ InverseTargetEvaluation

virtual bool Barotrauma.AIObjectiveLoop< T >.InverseTargetEvaluation
get

Definition at line 49 of file AIObjectiveLoop.cs.

◆ IsLoop

override bool Barotrauma.AIObjectiveLoop< T >.IsLoop
getset

Definition at line 55 of file AIObjectiveLoop.cs.

◆ MaxTargets

virtual int Barotrauma.AIObjectiveLoop< T >.MaxTargets
getprotected

Definition at line 53 of file AIObjectiveLoop.cs.

◆ Objectives

Dictionary<T, AIObjective> Barotrauma.AIObjectiveLoop< T >.Objectives = new Dictionary<T, AIObjective>()
get

Definition at line 10 of file AIObjectiveLoop.cs.

◆ ReportedTargets

HashSet<T> Barotrauma.AIObjectiveLoop< T >.ReportedTargets = new HashSet<T>()
get

Definition at line 22 of file AIObjectiveLoop.cs.

◆ ResetWhenClearingIgnoreList

virtual bool Barotrauma.AIObjectiveLoop< T >.ResetWhenClearingIgnoreList
getprotected

Definition at line 50 of file AIObjectiveLoop.cs.

◆ Targets

HashSet<T> Barotrauma.AIObjectiveLoop< T >.Targets = new HashSet<T>()
get

Definition at line 9 of file AIObjectiveLoop.cs.

◆ TargetUpdateTimeMultiplier

virtual float Barotrauma.AIObjectiveLoop< T >.TargetUpdateTimeMultiplier = 1
getprotected

Definition at line 14 of file AIObjectiveLoop.cs.