Barotrauma Client
Loading...
Searching...
No Matches
Barotrauma.AIObjectiveManager Class Reference

Public Types

enum  ObjectiveType {
  None = 0 , Order = 1 , Objective = 2 , MinValue = 0 ,
  MaxValue = 2
}
 

Public Member Functions

 AIObjectiveManager (Character character)
 
void AddObjective (AIObjective objective)
 
void AddObjective< T > (T objective)
 
void CreateAutonomousObjectives ()
 
void AddObjective< T > (T objective, float delay, Action callback=null)
 
GetObjective< T > ()
 
float GetCurrentPriority ()
 Returns the highest priority of the current objective and its subobjectives.
 
void UpdateObjectives (float deltaTime)
 
void SortObjectives ()
 
void DoCurrentObjective (float deltaTime)
 
void SetForcedOrder (AIObjective objective)
 
void ClearForcedOrder ()
 
void SetOrder (Order order, bool speak)
 
AIObjective CreateObjective (Order order, float priorityModifier=1)
 
bool IsCurrentOrder< T > ()
 Only checks the current order. Deprecated, use pattern matching instead.
 
bool IsCurrentObjective< T > ()
 Checks the current objective (which can be an order too). Deprecated, use pattern matching instead.
 
bool HasObjectiveOrOrder< T > ()
 Checks if any objectives or orders are of the specified type. Regardless of whether the objective is active or inactive.
 
AIObjective GetActiveObjective ()
 
GetOrder< T > ()
 Return the first order whose objective is of the given type. Can return null.
 
Order GetOrder (AIObjective objective)
 Return the first order with the specified objective. Can return null.
 
GetLastActiveObjective< T > ()
 Returns the last active objective of the specified objective type. Should generally be used to get the active objective (or subobjective) of objectives that don't sort their subobjectives by priority (see AIObjective.AllowSubObjectiveSorting.
 
GetFirstActiveObjective< T > ()
 Returns the first active objective of the specified objective type. Should generally be used to get the active objective (or subobjective) of objectives that sort their subobjectives by priority, such as those that inherit AIObjectiveLoop.
 
IEnumerable< T > GetActiveObjectives< T > ()
 Returns all active objectives of the specific type.
 
bool HasActiveObjective< T > ()
 
bool IsOrder (AIObjective objective)
 
bool HasOrders ()
 
bool HasOrder< T > (Func< T, bool > predicate=null)
 
float GetOrderPriority (AIObjective objective)
 
Order GetCurrentOrderInfo ()
 

Public Attributes

bool FailedToFindDivingGearForDepth
 

Static Public Attributes

const float MaxObjectivePriority = 100
 Highest possible priority for any objective. Used in certain cases where the character needs to react immediately to survive, such as finding a suit when under pressure or getting out of a burning room.
 
const float EmergencyObjectivePriority = 90
 Priority of objectives such as finding safety, rescuing someone in a critical state or defending against an attacker (= objectives that are critical for saving the character's or someone else's life)
 
const float HighestOrderPriority = 70
 Maximum priority of an order given to the character (forced order, or the leftmost order in the crew list)
 
const float LowestOrderPriority = 60
 Maximum priority of an order given to the character (rightmost order in the crew list)
 
const float RunPriority = 50
 Objectives with a priority equal to or higher than this make the character run.
 
const float baseDevotion = 5
 

Properties

List< AIObjectiveObjectives = new List<AIObjective>() [get]
 Excluding the current order.
 
HumanAIController HumanAIController [get]
 
float WaitTimer [get, set]
 When set above zero, the character will stand still doing nothing until the timer runs out. Does not affect orders, find safety or combat.
 
List< OrderCurrentOrders = new List<Order>() [get]
 
AIObjective CurrentOrder [get]
 The AIObjective in CurrentOrders with the highest AIObjective.Priority
 
AIObjective ForcedOrder [get]
 
AIObjective CurrentObjective [get]
 Includes orders.
 
Dictionary< AIObjective, CoroutineHandleDelayedObjectives = new Dictionary<AIObjective, CoroutineHandle>() [get]
 
bool FailedAutonomousObjectives [get]
 

Member Enumeration Documentation

◆ ObjectiveType

Enumerator
None 
Order 
Objective 
MinValue 
MaxValue 

Constructor & Destructor Documentation

◆ AIObjectiveManager()

Barotrauma.AIObjectiveManager.AIObjectiveManager ( Character character)

Member Function Documentation

◆ AddObjective()

void Barotrauma.AIObjectiveManager.AddObjective ( AIObjective objective)

◆ AddObjective< T >() [1/2]

Type Constraints
T :AIObjective 

◆ AddObjective< T >() [2/2]

void Barotrauma.AIObjectiveManager.AddObjective< T > ( T objective,
float delay,
Action callback = null )
Type Constraints
T :AIObjective 

◆ ClearForcedOrder()

void Barotrauma.AIObjectiveManager.ClearForcedOrder ( )

◆ CreateAutonomousObjectives()

void Barotrauma.AIObjectiveManager.CreateAutonomousObjectives ( )

◆ CreateObjective()

AIObjective Barotrauma.AIObjectiveManager.CreateObjective ( Order order,
float priorityModifier = 1 )

◆ DoCurrentObjective()

void Barotrauma.AIObjectiveManager.DoCurrentObjective ( float deltaTime)

◆ GetActiveObjective()

AIObjective Barotrauma.AIObjectiveManager.GetActiveObjective ( )

◆ GetActiveObjectives< T >()

IEnumerable< T > Barotrauma.AIObjectiveManager.GetActiveObjectives< T > ( )

Returns all active objectives of the specific type.

Type Constraints
T :AIObjective 

◆ GetCurrentOrderInfo()

Order Barotrauma.AIObjectiveManager.GetCurrentOrderInfo ( )

◆ GetCurrentPriority()

float Barotrauma.AIObjectiveManager.GetCurrentPriority ( )

Returns the highest priority of the current objective and its subobjectives.

◆ GetFirstActiveObjective< T >()

T Barotrauma.AIObjectiveManager.GetFirstActiveObjective< T > ( )

Returns the first active objective of the specified objective type. Should generally be used to get the active objective (or subobjective) of objectives that sort their subobjectives by priority, such as those that inherit AIObjectiveLoop.

Returns
The first active objective of the specified type if found.
Type Constraints
T :AIObjective 

◆ GetLastActiveObjective< T >()

T Barotrauma.AIObjectiveManager.GetLastActiveObjective< T > ( )

Returns the last active objective of the specified objective type. Should generally be used to get the active objective (or subobjective) of objectives that don't sort their subobjectives by priority (see AIObjective.AllowSubObjectiveSorting.

Returns
The last active objective of the specified type if found.
Type Constraints
T :AIObjective 

◆ GetObjective< T >()

T Barotrauma.AIObjectiveManager.GetObjective< T > ( )
Type Constraints
T :AIObjective 

◆ GetOrder()

Order Barotrauma.AIObjectiveManager.GetOrder ( AIObjective objective)

Return the first order with the specified objective. Can return null.

◆ GetOrder< T >()

Return the first order whose objective is of the given type. Can return null.

Type Constraints
T :AIObjective 

◆ GetOrderPriority()

float Barotrauma.AIObjectiveManager.GetOrderPriority ( AIObjective objective)

◆ HasActiveObjective< T >()

bool Barotrauma.AIObjectiveManager.HasActiveObjective< T > ( )
Type Constraints
T :AIObjective 

◆ HasObjectiveOrOrder< T >()

bool Barotrauma.AIObjectiveManager.HasObjectiveOrOrder< T > ( )

Checks if any objectives or orders are of the specified type. Regardless of whether the objective is active or inactive.

Type Constraints
T :AIObjective 

◆ HasOrder< T >()

bool Barotrauma.AIObjectiveManager.HasOrder< T > ( Func< T, bool > predicate = null)
Type Constraints
T :AIObjective 

◆ HasOrders()

bool Barotrauma.AIObjectiveManager.HasOrders ( )

◆ IsCurrentObjective< T >()

bool Barotrauma.AIObjectiveManager.IsCurrentObjective< T > ( )

Checks the current objective (which can be an order too). Deprecated, use pattern matching instead.

Type Constraints
T :AIObjective 

◆ IsCurrentOrder< T >()

bool Barotrauma.AIObjectiveManager.IsCurrentOrder< T > ( )

Only checks the current order. Deprecated, use pattern matching instead.

Type Constraints
T :AIObjective 

◆ IsOrder()

bool Barotrauma.AIObjectiveManager.IsOrder ( AIObjective objective)

◆ SetForcedOrder()

void Barotrauma.AIObjectiveManager.SetForcedOrder ( AIObjective objective)

◆ SetOrder()

void Barotrauma.AIObjectiveManager.SetOrder ( Order order,
bool speak )

◆ SortObjectives()

void Barotrauma.AIObjectiveManager.SortObjectives ( )

◆ UpdateObjectives()

void Barotrauma.AIObjectiveManager.UpdateObjectives ( float deltaTime)

Member Data Documentation

◆ baseDevotion

const float Barotrauma.AIObjectiveManager.baseDevotion = 5
static

◆ EmergencyObjectivePriority

const float Barotrauma.AIObjectiveManager.EmergencyObjectivePriority = 90
static

Priority of objectives such as finding safety, rescuing someone in a critical state or defending against an attacker (= objectives that are critical for saving the character's or someone else's life)

◆ FailedToFindDivingGearForDepth

bool Barotrauma.AIObjectiveManager.FailedToFindDivingGearForDepth

◆ HighestOrderPriority

const float Barotrauma.AIObjectiveManager.HighestOrderPriority = 70
static

Maximum priority of an order given to the character (forced order, or the leftmost order in the crew list)

◆ LowestOrderPriority

const float Barotrauma.AIObjectiveManager.LowestOrderPriority = 60
static

Maximum priority of an order given to the character (rightmost order in the crew list)

◆ MaxObjectivePriority

const float Barotrauma.AIObjectiveManager.MaxObjectivePriority = 100
static

Highest possible priority for any objective. Used in certain cases where the character needs to react immediately to survive, such as finding a suit when under pressure or getting out of a burning room.

◆ RunPriority

const float Barotrauma.AIObjectiveManager.RunPriority = 50
static

Objectives with a priority equal to or higher than this make the character run.

Property Documentation

◆ CurrentObjective

AIObjective Barotrauma.AIObjectiveManager.CurrentObjective
get

Includes orders.

◆ CurrentOrder

AIObjective Barotrauma.AIObjectiveManager.CurrentOrder
get

◆ CurrentOrders

List<Order> Barotrauma.AIObjectiveManager.CurrentOrders = new List<Order>()
get

◆ DelayedObjectives

Dictionary<AIObjective, CoroutineHandle> Barotrauma.AIObjectiveManager.DelayedObjectives = new Dictionary<AIObjective, CoroutineHandle>()
get

◆ FailedAutonomousObjectives

bool Barotrauma.AIObjectiveManager.FailedAutonomousObjectives
get

◆ ForcedOrder

AIObjective Barotrauma.AIObjectiveManager.ForcedOrder
get

◆ HumanAIController

HumanAIController Barotrauma.AIObjectiveManager.HumanAIController
get

◆ Objectives

List<AIObjective> Barotrauma.AIObjectiveManager.Objectives = new List<AIObjective>()
get

Excluding the current order.

◆ WaitTimer

float Barotrauma.AIObjectiveManager.WaitTimer
getset

When set above zero, the character will stand still doing nothing until the timer runs out. Does not affect orders, find safety or combat.


The documentation for this class was generated from the following file: