Barotrauma Client Doc
Barotrauma.AIObjectiveManager Class Reference

Public Types

enum class  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 ()
 
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 > ()
 
bool IsCurrentObjective< T > ()
 
bool IsActiveObjective< T > ()
 
AIObjective GetActiveObjective ()
 
GetOrder< T > ()
 
GetLastActiveObjective< T > ()
 
GetFirstActiveObjective< T > ()
 
IEnumerable< T > GetActiveObjectives< T > ()
 Returns all active objectives of the specific type. Creates a new collection -> don't use too frequently. More...
 
bool HasActiveObjective< T > ()
 
bool IsOrder (AIObjective objective)
 
bool HasOrders ()
 
bool HasOrder< T > (Func< T, bool > predicate=null)
 
float GetOrderPriority (AIObjective objective)
 
Order GetCurrentOrderInfo ()
 

Static Public Attributes

const float MaxObjectivePriority = 100
 
const float EmergencyObjectivePriority = 90
 
const float HighestOrderPriority = 70
 
const float LowestOrderPriority = 60
 
const float RunPriority = 50
 
const float baseDevotion = 5
 

Properties

List< AIObjectiveObjectives = new List<AIObjective>() [get]
 Excluding the current order. More...
 
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. More...
 
List< OrderCurrentOrders = new List<Order>() [get]
 
AIObjective?? CurrentOrder [get]
 The AIObjective in CurrentOrders with the highest AIObjective.Priority More...
 
AIObjective ForcedOrder [get]
 
AIObjective CurrentObjective [get]
 
Dictionary< AIObjective, CoroutineHandleDelayedObjectives = new Dictionary<AIObjective, CoroutineHandle>() [get]
 
bool FailedAutonomousObjectives [get]
 

Detailed Description

Definition at line 11 of file AIObjectiveManager.cs.

Member Enumeration Documentation

◆ ObjectiveType

Enumerator
None 
Order 
Objective 
MinValue 
MaxValue 

Definition at line 13 of file AIObjectiveManager.cs.

Constructor & Destructor Documentation

◆ AIObjectiveManager()

Barotrauma.AIObjectiveManager.AIObjectiveManager ( Character  character)

Definition at line 72 of file AIObjectiveManager.cs.

Member Function Documentation

◆ AddObjective()

void Barotrauma.AIObjectiveManager.AddObjective ( AIObjective  objective)

Definition at line 78 of file AIObjectiveManager.cs.

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

void Barotrauma.AIObjectiveManager.AddObjective< T > ( objective)
Type Constraints
T :AIObjective 

Definition at line 83 of file AIObjectiveManager.cs.

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

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

Definition at line 189 of file AIObjectiveManager.cs.

◆ ClearForcedOrder()

void Barotrauma.AIObjectiveManager.ClearForcedOrder ( )

Definition at line 350 of file AIObjectiveManager.cs.

◆ CreateAutonomousObjectives()

void Barotrauma.AIObjectiveManager.CreateAutonomousObjectives ( )

Definition at line 125 of file AIObjectiveManager.cs.

◆ CreateObjective()

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

Definition at line 429 of file AIObjectiveManager.cs.

◆ DoCurrentObjective()

void Barotrauma.AIObjectiveManager.DoCurrentObjective ( float  deltaTime)

Definition at line 333 of file AIObjectiveManager.cs.

◆ GetActiveObjective()

AIObjective Barotrauma.AIObjectiveManager.GetActiveObjective ( )

◆ GetActiveObjectives< T >()

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

Returns all active objectives of the specific type. Creates a new collection -> don't use too frequently.

Type Constraints
T :AIObjective 

Definition at line 679 of file AIObjectiveManager.cs.

◆ GetCurrentOrderInfo()

Order Barotrauma.AIObjectiveManager.GetCurrentOrderInfo ( )

Definition at line 735 of file AIObjectiveManager.cs.

◆ GetCurrentPriority()

float Barotrauma.AIObjectiveManager.GetCurrentPriority ( )

Definition at line 242 of file AIObjectiveManager.cs.

◆ GetFirstActiveObjective< T >()

T Barotrauma.AIObjectiveManager.GetFirstActiveObjective< T > ( )
Type Constraints
T :AIObjective 
T :CurrentObjective 
T :GetSubObjectivesRecursive 
T :includingSelf 
T :true 
T :FirstOrDefault 
T :so 
T :so 
T :is 
T :T 
T :as 
T :T 

◆ GetLastActiveObjective< T >()

T Barotrauma.AIObjectiveManager.GetLastActiveObjective< T > ( )
Type Constraints
T :AIObjective 
T :CurrentObjective 
T :GetSubObjectivesRecursive 
T :includingSelf 
T :true 
T :LastOrDefault 
T :so 
T :so 
T :is 
T :T 
T :as 
T :T 

◆ GetObjective< T >()

T Barotrauma.AIObjectiveManager.GetObjective< T > ( )
Type Constraints
T :AIObjective 
T :Objectives.FirstOrDefault 
T :o 
T :o 
T :is 
T :T 
T :as 
T :T 

◆ GetOrder< T >()

T Barotrauma.AIObjectiveManager.GetOrder< T > ( )
Type Constraints
T :AIObjective 
T :CurrentOrders.FirstOrDefault 
T :o 
T :o.Objective 
T :is 
T :T 
T :Objective 
T :as 
T :T 

◆ GetOrderPriority()

float Barotrauma.AIObjectiveManager.GetOrderPriority ( AIObjective  objective)

Definition at line 706 of file AIObjectiveManager.cs.

◆ HasActiveObjective< T >()

bool Barotrauma.AIObjectiveManager.HasActiveObjective< T > ( )
Type Constraints
T :AIObjective 
T :CurrentObjective 
T :is 
T :T 
T :CurrentObjective 
T :null 
T :CurrentObjective.GetSubObjectivesRecursive() 
T :Any 
T :so 
T :so 
T :is 
T :T 

◆ HasOrder< T >()

bool Barotrauma.AIObjectiveManager.HasOrder< T > ( Func< T, bool >  predicate = null)
Type Constraints
T :AIObjective 
T :ForcedOrder 
T :is 
T :T 
T :forcedOrder 
T :predicate 
T :null 
T :predicate 
T :forcedOrder 
T :CurrentOrders.Any 
T :o 
T :o.Objective 
T :is 
T :T 
T :order 
T :predicate 
T :null 
T :predicate 
T :order 

◆ HasOrders()

bool Barotrauma.AIObjectiveManager.HasOrders ( )

Definition at line 697 of file AIObjectiveManager.cs.

◆ IsActiveObjective< T >()

bool Barotrauma.AIObjectiveManager.IsActiveObjective< T > ( )
Type Constraints
T :AIObjective 
T :GetActiveObjective() 
T :is 
T :T 

◆ IsCurrentObjective< T >()

bool Barotrauma.AIObjectiveManager.IsCurrentObjective< T > ( )
Type Constraints
T :AIObjective 
T :CurrentObjective 
T :is 
T :T 

◆ IsCurrentOrder< T >()

bool Barotrauma.AIObjectiveManager.IsCurrentOrder< T > ( )
Type Constraints
T :AIObjective 
T :CurrentOrder 
T :is 
T :T 

◆ IsOrder()

bool Barotrauma.AIObjectiveManager.IsOrder ( AIObjective  objective)

Definition at line 687 of file AIObjectiveManager.cs.

◆ SetForcedOrder()

void Barotrauma.AIObjectiveManager.SetForcedOrder ( AIObjective  objective)

Definition at line 345 of file AIObjectiveManager.cs.

◆ SetOrder()

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

Definition at line 356 of file AIObjectiveManager.cs.

◆ SortObjectives()

void Barotrauma.AIObjectiveManager.SortObjectives ( )

Definition at line 304 of file AIObjectiveManager.cs.

◆ UpdateObjectives()

void Barotrauma.AIObjectiveManager.UpdateObjectives ( float  deltaTime)

Definition at line 247 of file AIObjectiveManager.cs.

Member Data Documentation

◆ baseDevotion

const float Barotrauma.AIObjectiveManager.baseDevotion = 5
static

Definition at line 29 of file AIObjectiveManager.cs.

◆ EmergencyObjectivePriority

const float Barotrauma.AIObjectiveManager.EmergencyObjectivePriority = 90
static

Definition at line 24 of file AIObjectiveManager.cs.

◆ HighestOrderPriority

const float Barotrauma.AIObjectiveManager.HighestOrderPriority = 70
static

Definition at line 25 of file AIObjectiveManager.cs.

◆ LowestOrderPriority

const float Barotrauma.AIObjectiveManager.LowestOrderPriority = 60
static

Definition at line 26 of file AIObjectiveManager.cs.

◆ MaxObjectivePriority

const float Barotrauma.AIObjectiveManager.MaxObjectivePriority = 100
static

Definition at line 23 of file AIObjectiveManager.cs.

◆ RunPriority

const float Barotrauma.AIObjectiveManager.RunPriority = 50
static

Definition at line 27 of file AIObjectiveManager.cs.

Property Documentation

◆ CurrentObjective

AIObjective Barotrauma.AIObjectiveManager.CurrentObjective
get

Definition at line 70 of file AIObjectiveManager.cs.

◆ CurrentOrder

AIObjective?? Barotrauma.AIObjectiveManager.CurrentOrder
get

The AIObjective in CurrentOrders with the highest AIObjective.Priority

Definition at line 57 of file AIObjectiveManager.cs.

◆ CurrentOrders

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

Definition at line 53 of file AIObjectiveManager.cs.

◆ DelayedObjectives

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

Definition at line 113 of file AIObjectiveManager.cs.

◆ FailedAutonomousObjectives

bool Barotrauma.AIObjectiveManager.FailedAutonomousObjectives
get

Definition at line 114 of file AIObjectiveManager.cs.

◆ ForcedOrder

AIObjective Barotrauma.AIObjectiveManager.ForcedOrder
get

Definition at line 69 of file AIObjectiveManager.cs.

◆ HumanAIController

HumanAIController Barotrauma.AIObjectiveManager.HumanAIController
get

Definition at line 38 of file AIObjectiveManager.cs.

◆ Objectives

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

Excluding the current order.

Definition at line 34 of file AIObjectiveManager.cs.

◆ 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.

Definition at line 44 of file AIObjectiveManager.cs.