Barotrauma Client Doc
Barotrauma.Order Class Reference

Public Types

enum class  OrderType { Current , Previous }
 
enum class  OrderTargetType { Entity , Position , WallSection }
 

Public Member Functions

 Order (OrderPrefab prefab, Entity targetEntity, ItemComponent targetItem, Character orderGiver=null, bool isAutonomous=false)
 Constructor for orders with the target type OrderTargetType.Entity More...
 
 Order (OrderPrefab prefab, Identifier option, Entity targetEntity, ItemComponent targetItem, Character orderGiver=null, bool isAutonomous=false)
 Constructor for orders with the target type OrderTargetType.Entity More...
 
 Order (OrderPrefab prefab, OrderTarget target, Character orderGiver=null)
 Constructor for orders with the target type OrderTargetType.Position More...
 
 Order (OrderPrefab prefab, Identifier option, OrderTarget target, Character orderGiver=null)
 Constructor for orders with the target type OrderTargetType.Position More...
 
 Order (OrderPrefab prefab, Structure wall, int? sectionIndex, Character orderGiver=null)
 Constructor for orders with the target type OrderTargetType.WallSection More...
 
 Order (OrderPrefab prefab, Identifier option, Structure wall, int? sectionIndex, Character orderGiver=null)
 Constructor for orders with the target type OrderTargetType.WallSection More...
 
Order WithOption (Identifier option)
 
Order WithManualPriority (int newPriority)
 
Order WithOrderGiver (Character orderGiver)
 
Order WithObjective (AIObjective objective)
 
Order WithTargetEntity (Entity entity)
 
Order WithTargetSpatialEntity (ISpatialEntity spatialEntity)
 
Order WithItemComponent (Item item, ItemComponent component=null)
 
Order WithWallSection (Structure wall, int? sectionIndex)
 
Order WithType (OrderType type)
 
Order WithTargetPosition (OrderTarget targetPosition)
 
Order Clone ()
 
Order GetDismissal ()
 
bool HasAppropriateJob (Character character)
 
bool HasPreferredJob (Character character)
 
string GetChatMessage (string targetCharacterName, string targetRoomName, bool givingOrderToSelf, Identifier orderOption=default, bool isNewOrder=true)
 
ItemComponent GetTargetItemComponent (Item item)
 Get the target item component based on the target item type More...
 
bool TryGetTargetItemComponent (Item item, out ItemComponent firstMatchingComponent)
 
List< ItemGetMatchingItems (Submarine submarine, bool mustBelongToPlayerSub, CharacterTeamType? requiredTeam=null, Character interactableFor=null)
 
Parameters
interactableForOnly returns items which are interactable for this character
More...
 
List< ItemGetMatchingItems (bool mustBelongToPlayerSub, Character interactableFor=null)
 
Parameters
interactableForOnly returns items which are interactable for this character
More...
 
LocalizedString GetOptionName (string id)
 
LocalizedString GetOptionName (Identifier id)
 
LocalizedString GetOptionName (int index)
 
bool MatchesOrder (Identifier orderIdentifier, Identifier orderOption)
 
bool MatchesOrder (Order order)
 
bool MatchesDismissedOrder (Identifier dismissOrderOption)
 
ImmutableArray< IdentifierGetTargetItems (Identifier option=default)
 
override string ToString ()
 

Static Public Member Functions

static Identifier GetDismissOrderOption (Order order)
 Used to create the order option for the Dismiss order to know which order it targets More...
 

Public Attributes

readonly OrderPrefab Prefab
 
readonly Identifier Option
 
readonly int ManualPriority
 
readonly OrderType Type
 
readonly AIObjective Objective
 
readonly Entity TargetEntity
 
readonly ItemComponent TargetItemComponent
 
readonly Controller ConnectedController
 
readonly Character OrderGiver
 
readonly OrderTarget TargetPosition
 
readonly OrderTargetType TargetType
 
readonly? int WallSectionIndex
 
readonly bool UseController
 

Properties

bool IsCurrentOrder [get]
 
bool IsDismissal [get]
 
ISpatialEntity??? TargetSpatialEntity [get]
 Note this property doesn't return the follow target of the Follow objective, as expected! More...
 
Hull TargetHull [get]
 
LocalizedString Name [get]
 
LocalizedString ContextualName [get]
 
Identifier Identifier [get]
 
Type ItemComponentType [get]
 
bool CanTypeBeSubclass [get]
 
ref readonly ImmutableArray< IdentifierControllerTags [get]
 
ref readonly ImmutableArray< IdentifierTargetItems [get]
 
ref readonly ImmutableArray< IdentifierRequireItems [get]
 
ref readonly ImmutableArray< IdentifierOptions [get]
 
ref readonly ImmutableArray< IdentifierHiddenOptions [get]
 
ref readonly ImmutableArray< IdentifierAllOptions [get]
 
Sprite SymbolSprite [get]
 
Color Color [get]
 
bool TargetAllCharacters [get]
 
ref readonly ImmutableArray< IdentifierAppropriateJobs [get]
 
float FadeOutTime [get]
 
bool MustSetTarget [get]
 
Identifier AppropriateSkill [get]
 
OrderCategoryCategory [get]
 
bool MustManuallyAssign [get]
 
bool IsIgnoreOrder [get]
 
bool DrawIconWhenContained [get]
 
bool Hidden [get]
 
bool IgnoreAtOutpost [get]
 
bool IsReport [get]
 
bool AutoDismiss [get]
 
int AssignmentPriority [get]
 
bool ColoredWhenControllingGiver [get]
 
bool DisplayGiverInTooltip [get]
 

Detailed Description

Definition at line 451 of file Order.cs.

Member Enumeration Documentation

◆ OrderTargetType

Enumerator
Entity 
Position 
WallSection 

Definition at line 501 of file Order.cs.

◆ OrderType

Enumerator
Current 
Previous 

Definition at line 461 of file Order.cs.

Constructor & Destructor Documentation

◆ Order() [1/6]

Barotrauma.Order.Order ( OrderPrefab  prefab,
Entity  targetEntity,
ItemComponent  targetItem,
Character  orderGiver = null,
bool  isAutonomous = false 
)

Constructor for orders with the target type OrderTargetType.Entity

Definition at line 547 of file Order.cs.

◆ Order() [2/6]

Barotrauma.Order.Order ( OrderPrefab  prefab,
Identifier  option,
Entity  targetEntity,
ItemComponent  targetItem,
Character  orderGiver = null,
bool  isAutonomous = false 
)

Constructor for orders with the target type OrderTargetType.Entity

Definition at line 553 of file Order.cs.

◆ Order() [3/6]

Barotrauma.Order.Order ( OrderPrefab  prefab,
OrderTarget  target,
Character  orderGiver = null 
)

Constructor for orders with the target type OrderTargetType.Position

Definition at line 559 of file Order.cs.

◆ Order() [4/6]

Barotrauma.Order.Order ( OrderPrefab  prefab,
Identifier  option,
OrderTarget  target,
Character  orderGiver = null 
)

Constructor for orders with the target type OrderTargetType.Position

Definition at line 565 of file Order.cs.

◆ Order() [5/6]

Barotrauma.Order.Order ( OrderPrefab  prefab,
Structure  wall,
int?  sectionIndex,
Character  orderGiver = null 
)

Constructor for orders with the target type OrderTargetType.WallSection

Definition at line 571 of file Order.cs.

◆ Order() [6/6]

Barotrauma.Order.Order ( OrderPrefab  prefab,
Identifier  option,
Structure  wall,
int?  sectionIndex,
Character  orderGiver = null 
)

Constructor for orders with the target type OrderTargetType.WallSection

Definition at line 577 of file Order.cs.

Member Function Documentation

◆ Clone()

Order Barotrauma.Order.Clone ( )

Definition at line 746 of file Order.cs.

◆ GetChatMessage()

string Barotrauma.Order.GetChatMessage ( string  targetCharacterName,
string  targetRoomName,
bool  givingOrderToSelf,
Identifier  orderOption = default,
bool  isNewOrder = true 
)

◆ GetDismissal()

Order Barotrauma.Order.GetDismissal ( )

Definition at line 751 of file Order.cs.

◆ GetDismissOrderOption()

static Identifier Barotrauma.Order.GetDismissOrderOption ( Order  order)
static

Used to create the order option for the Dismiss order to know which order it targets

Parameters
orderInfoThe order to target with the dismiss order

Definition at line 812 of file Order.cs.

◆ GetMatchingItems() [1/2]

List<Item> Barotrauma.Order.GetMatchingItems ( bool  mustBelongToPlayerSub,
Character  interactableFor = null 
)

Parameters
interactableForOnly returns items which are interactable for this character

Definition at line 788 of file Order.cs.

◆ GetMatchingItems() [2/2]

List<Item> Barotrauma.Order.GetMatchingItems ( Submarine  submarine,
bool  mustBelongToPlayerSub,
CharacterTeamType requiredTeam = null,
Character  interactableFor = null 
)

Parameters
interactableForOnly returns items which are interactable for this character

Definition at line 781 of file Order.cs.

◆ GetOptionName() [1/3]

LocalizedString Barotrauma.Order.GetOptionName ( Identifier  id)

Definition at line 798 of file Order.cs.

◆ GetOptionName() [2/3]

LocalizedString Barotrauma.Order.GetOptionName ( int  index)

Definition at line 803 of file Order.cs.

◆ GetOptionName() [3/3]

LocalizedString Barotrauma.Order.GetOptionName ( string  id)

Definition at line 793 of file Order.cs.

◆ GetTargetItemComponent()

ItemComponent Barotrauma.Order.GetTargetItemComponent ( Item  item)

Get the target item component based on the target item type

Definition at line 770 of file Order.cs.

◆ GetTargetItems()

ImmutableArray<Identifier> Barotrauma.Order.GetTargetItems ( Identifier  option = default)

◆ HasAppropriateJob()

bool Barotrauma.Order.HasAppropriateJob ( Character  character)

◆ HasPreferredJob()

bool Barotrauma.Order.HasPreferredJob ( Character  character)

◆ MatchesDismissedOrder()

bool Barotrauma.Order.MatchesDismissedOrder ( Identifier  dismissOrderOption)

Definition at line 826 of file Order.cs.

◆ MatchesOrder() [1/2]

bool Barotrauma.Order.MatchesOrder ( Identifier  orderIdentifier,
Identifier  orderOption 
)

◆ MatchesOrder() [2/2]

bool Barotrauma.Order.MatchesOrder ( Order  order)

◆ ToString()

override string Barotrauma.Order.ToString ( )

Definition at line 846 of file Order.cs.

◆ TryGetTargetItemComponent()

bool Barotrauma.Order.TryGetTargetItemComponent ( Item  item,
out ItemComponent  firstMatchingComponent 
)

Definition at line 775 of file Order.cs.

◆ WithItemComponent()

Order Barotrauma.Order.WithItemComponent ( Item  item,
ItemComponent  component = null 
)

Definition at line 721 of file Order.cs.

◆ WithManualPriority()

Order Barotrauma.Order.WithManualPriority ( int  newPriority)

Definition at line 681 of file Order.cs.

◆ WithObjective()

Order Barotrauma.Order.WithObjective ( AIObjective  objective)

Definition at line 691 of file Order.cs.

◆ WithOption()

Order Barotrauma.Order.WithOption ( Identifier  option)

Definition at line 676 of file Order.cs.

◆ WithOrderGiver()

Order Barotrauma.Order.WithOrderGiver ( Character  orderGiver)

Definition at line 686 of file Order.cs.

◆ WithTargetEntity()

Order Barotrauma.Order.WithTargetEntity ( Entity  entity)

Definition at line 696 of file Order.cs.

◆ WithTargetPosition()

Order Barotrauma.Order.WithTargetPosition ( OrderTarget  targetPosition)

Definition at line 741 of file Order.cs.

◆ WithTargetSpatialEntity()

Order Barotrauma.Order.WithTargetSpatialEntity ( ISpatialEntity  spatialEntity)

Definition at line 701 of file Order.cs.

◆ WithType()

Order Barotrauma.Order.WithType ( OrderType  type)

Definition at line 736 of file Order.cs.

◆ WithWallSection()

Order Barotrauma.Order.WithWallSection ( Structure  wall,
int?  sectionIndex 
)

Definition at line 731 of file Order.cs.

Member Data Documentation

◆ ConnectedController

readonly Controller Barotrauma.Order.ConnectedController

Definition at line 469 of file Order.cs.

◆ ManualPriority

readonly int Barotrauma.Order.ManualPriority

Definition at line 455 of file Order.cs.

◆ Objective

readonly AIObjective Barotrauma.Order.Objective

Definition at line 457 of file Order.cs.

◆ Option

readonly Identifier Barotrauma.Order.Option

Definition at line 454 of file Order.cs.

◆ OrderGiver

readonly Character Barotrauma.Order.OrderGiver

Definition at line 471 of file Order.cs.

◆ Prefab

readonly OrderPrefab Barotrauma.Order.Prefab

Definition at line 453 of file Order.cs.

◆ TargetEntity

readonly Entity Barotrauma.Order.TargetEntity

Definition at line 467 of file Order.cs.

◆ TargetItemComponent

readonly ItemComponent Barotrauma.Order.TargetItemComponent

Definition at line 468 of file Order.cs.

◆ TargetPosition

readonly OrderTarget Barotrauma.Order.TargetPosition

Definition at line 473 of file Order.cs.

◆ TargetType

readonly OrderTargetType Barotrauma.Order.TargetType

Definition at line 507 of file Order.cs.

◆ Type

readonly OrderType Barotrauma.Order.Type

Definition at line 456 of file Order.cs.

◆ UseController

readonly bool Barotrauma.Order.UseController

Definition at line 542 of file Order.cs.

◆ WallSectionIndex

readonly? int Barotrauma.Order.WallSectionIndex

Definition at line 508 of file Order.cs.

Property Documentation

◆ AllOptions

ref readonly ImmutableArray<Identifier> Barotrauma.Order.AllOptions
get

Definition at line 520 of file Order.cs.

◆ AppropriateJobs

ref readonly ImmutableArray<Identifier> Barotrauma.Order.AppropriateJobs
get

Definition at line 524 of file Order.cs.

◆ AppropriateSkill

Identifier Barotrauma.Order.AppropriateSkill
get

Definition at line 527 of file Order.cs.

◆ AssignmentPriority

int Barotrauma.Order.AssignmentPriority
get

Definition at line 536 of file Order.cs.

◆ AutoDismiss

bool Barotrauma.Order.AutoDismiss
get

Definition at line 535 of file Order.cs.

◆ CanTypeBeSubclass

bool Barotrauma.Order.CanTypeBeSubclass
get

Definition at line 514 of file Order.cs.

◆ Category

OrderCategory? Barotrauma.Order.Category
get

Definition at line 528 of file Order.cs.

◆ Color

Color Barotrauma.Order.Color
get

Definition at line 522 of file Order.cs.

◆ ColoredWhenControllingGiver

bool Barotrauma.Order.ColoredWhenControllingGiver
get

Definition at line 538 of file Order.cs.

◆ ContextualName

LocalizedString Barotrauma.Order.ContextualName
get

Definition at line 511 of file Order.cs.

◆ ControllerTags

ref readonly ImmutableArray<Identifier> Barotrauma.Order.ControllerTags
get

Definition at line 515 of file Order.cs.

◆ DisplayGiverInTooltip

bool Barotrauma.Order.DisplayGiverInTooltip
get

Definition at line 539 of file Order.cs.

◆ DrawIconWhenContained

bool Barotrauma.Order.DrawIconWhenContained
get

Definition at line 531 of file Order.cs.

◆ FadeOutTime

float Barotrauma.Order.FadeOutTime
get

Definition at line 525 of file Order.cs.

◆ Hidden

bool Barotrauma.Order.Hidden
get

Definition at line 532 of file Order.cs.

◆ HiddenOptions

ref readonly ImmutableArray<Identifier> Barotrauma.Order.HiddenOptions
get

Definition at line 519 of file Order.cs.

◆ Identifier

Identifier Barotrauma.Order.Identifier
get

Definition at line 512 of file Order.cs.

◆ IgnoreAtOutpost

bool Barotrauma.Order.IgnoreAtOutpost
get

Definition at line 533 of file Order.cs.

◆ IsCurrentOrder

bool Barotrauma.Order.IsCurrentOrder
get

Definition at line 458 of file Order.cs.

◆ IsDismissal

bool Barotrauma.Order.IsDismissal
get

Definition at line 459 of file Order.cs.

◆ IsIgnoreOrder

bool Barotrauma.Order.IsIgnoreOrder
get

Definition at line 530 of file Order.cs.

◆ IsReport

bool Barotrauma.Order.IsReport
get

Definition at line 534 of file Order.cs.

◆ ItemComponentType

Type Barotrauma.Order.ItemComponentType
get

Definition at line 513 of file Order.cs.

◆ MustManuallyAssign

bool Barotrauma.Order.MustManuallyAssign
get

Definition at line 529 of file Order.cs.

◆ MustSetTarget

bool Barotrauma.Order.MustSetTarget
get

Definition at line 526 of file Order.cs.

◆ Name

LocalizedString Barotrauma.Order.Name
get

Definition at line 510 of file Order.cs.

◆ Options

ref readonly ImmutableArray<Identifier> Barotrauma.Order.Options
get

Definition at line 518 of file Order.cs.

◆ RequireItems

ref readonly ImmutableArray<Identifier> Barotrauma.Order.RequireItems
get

Definition at line 517 of file Order.cs.

◆ SymbolSprite

Sprite Barotrauma.Order.SymbolSprite
get

Definition at line 521 of file Order.cs.

◆ TargetAllCharacters

bool Barotrauma.Order.TargetAllCharacters
get

Definition at line 523 of file Order.cs.

◆ TargetHull

Hull Barotrauma.Order.TargetHull
get

Definition at line 499 of file Order.cs.

◆ TargetItems

ref readonly ImmutableArray<Identifier> Barotrauma.Order.TargetItems
get

Definition at line 516 of file Order.cs.

◆ TargetSpatialEntity

ISpatialEntity??? Barotrauma.Order.TargetSpatialEntity
get

Note this property doesn't return the follow target of the Follow objective, as expected!

Definition at line 480 of file Order.cs.