Barotrauma Client Doc
Barotrauma.OrderPrefab Class Reference
Inheritance diagram for Barotrauma.OrderPrefab:
Barotrauma.PrefabWithUintIdentifier Barotrauma.Prefab

Public Types

enum class  OrderTargetType { Entity , Position , WallSection }
 

Public Member Functions

 OrderPrefab (ContentXElement orderElement, OrdersFile file)
 
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, Identifier orderOption=default)
 
Parameters
interactableForOnly returns items which are interactable for this character
More...
 
List< ItemGetMatchingItems (bool mustBelongToPlayerSub, Character interactableFor=null, Identifier orderOption=default)
 
Parameters
interactableForOnly returns items which are interactable for this character
More...
 
LocalizedString GetOptionName (string id)
 
LocalizedString GetOptionName (Identifier id)
 
LocalizedString GetOptionName (int index)
 
ImmutableArray< IdentifierGetTargetItems (Identifier option=default)
 
bool TargetItemsMatchItem (Item item, Identifier option=default)
 
override void Dispose ()
 
Order CreateInstance (OrderTargetType targetType, Character orderGiver=null, bool isAutonomous=false)
 Create an Order instance with a null target More...
 
- Public Member Functions inherited from Barotrauma.Prefab
 Prefab (ContentFile file, Identifier identifier)
 
 Prefab (ContentFile file, ContentXElement element)
 

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...
 
static bool TargetItemsMatchItem (ImmutableArray< Identifier > targetItems, Item item)
 
- Static Public Member Functions inherited from Barotrauma.Prefab
static void DisallowCallFromConstructor ()
 

Public Attributes

readonly? OrderCategory Category
 
readonly Identifier CategoryIdentifier
 
readonly LocalizedString Name
 
readonly LocalizedString ContextualName
 Name that can be used with the contextual version of the order More...
 
readonly Sprite SymbolSprite
 
readonly Type ItemComponentType
 
readonly bool CanTypeBeSubclass
 
readonly ImmutableArray< IdentifierTargetItems
 
readonly ImmutableArray< IdentifierRequireItems
 
readonly bool TargetAllCharacters
 
bool TraitorModeOnly
 
readonly float FadeOutTime
 
readonly bool UseController
 
readonly ImmutableArray< IdentifierControllerTags
 
readonly ImmutableArray< IdentifierAppropriateJobs
 If defined, the order can only be quick-assigned to characters with these jobs. Or if it's a report, the icon will only be displayed to characters with these jobs. More...
 
readonly ImmutableArray< IdentifierOptions
 
readonly ImmutableArray< IdentifierHiddenOptions
 
readonly ImmutableArray< IdentifierAllOptions
 
readonly ListDictionary< Identifier, LocalizedStringOptionNames
 
readonly ImmutableDictionary< Identifier, SpriteOptionSprites
 
readonly bool MustSetTarget
 
readonly bool CanBeGeneralized
 Can the order be turned into a non-entity-targeting one if it was originally created with a target entity. Note: if MustSetTarget is true, CanBeGeneralized will always be false. More...
 
readonly Identifier AppropriateSkill
 
readonly bool Hidden
 
readonly bool IgnoreAtOutpost
 
readonly bool MustManuallyAssign
 
readonly bool AutoDismiss
 
readonly ImmutableArray< IdentifierPreferredJobs
 If defined, the order will be quick-assigned to characters with these jobs before characters with other jobs. More...
 
- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 

Static Public Attributes

static readonly PrefabCollection< OrderPrefabPrefabs = new PrefabCollection<OrderPrefab>()
 
static readonly Identifier DismissalIdentifier = "dismissed".ToIdentifier()
 
- Static Public Attributes inherited from Barotrauma.Prefab
static readonly ImmutableHashSet< Type > Types
 

Properties

static OrderPrefab Dismissal [get]
 
bool HasOptionSpecificTargetItems [get]
 
Color Color [get]
 
bool IsReport [get]
 
bool IsVisibleAsReportButton [get]
 
bool IsDismissal [get]
 
bool HasOptions [get]
 
OrderTargetType TargetType [get]
 
int? WallSectionIndex [get]
 
bool IsIgnoreOrder [get]
 
bool DrawIconWhenContained [get]
 Should the order icon be drawn when the order target is inside a container More...
 
int AssignmentPriority [get]
 Affects how high on the order list the order will be placed (i.e. the manual priority order when it's given) when it's first given. Manually rearranging orders will override this priority. More...
 
bool ColoredWhenControllingGiver [get]
 
bool DisplayGiverInTooltip [get]
 
- Properties inherited from Barotrauma.PrefabWithUintIdentifier
UInt32 UintIdentifier [get, set]
 
- Properties inherited from Barotrauma.Prefab
ContentPackageContentPackage [get]
 
ContentPath FilePath [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Barotrauma.PrefabWithUintIdentifier
 PrefabWithUintIdentifier (ContentFile file, Identifier identifier)
 
 PrefabWithUintIdentifier (ContentFile file, ContentXElement element)
 
- Protected Member Functions inherited from Barotrauma.Prefab
virtual Identifier DetermineIdentifier (XElement element)
 

Detailed Description

Definition at line 39 of file Order.cs.

Member Enumeration Documentation

◆ OrderTargetType

Enumerator
Entity 
Position 
WallSection 

Definition at line 132 of file Order.cs.

Constructor & Destructor Documentation

◆ OrderPrefab()

Barotrauma.OrderPrefab.OrderPrefab ( ContentXElement  orderElement,
OrdersFile  file 
)

Definition at line 156 of file Order.cs.

Member Function Documentation

◆ CreateInstance()

Order Barotrauma.OrderPrefab.CreateInstance ( OrderTargetType  targetType,
Character  orderGiver = null,
bool  isAutonomous = false 
)

Create an Order instance with a null target

Definition at line 430 of file Order.cs.

◆ Dispose()

override void Barotrauma.OrderPrefab.Dispose ( )
virtual

Implements Barotrauma.Prefab.

Definition at line 425 of file Order.cs.

◆ GetChatMessage()

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

Definition at line 276 of file Order.cs.

◆ GetDismissOrderOption()

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

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

Parameters
orderThe order to target with the dismiss order

Definition at line 391 of file Order.cs.

◆ GetMatchingItems() [1/2]

List<Item> Barotrauma.OrderPrefab.GetMatchingItems ( bool  mustBelongToPlayerSub,
Character  interactableFor = null,
Identifier  orderOption = default 
)

Parameters
interactableForOnly returns items which are interactable for this character

Definition at line 362 of file Order.cs.

◆ GetMatchingItems() [2/2]

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

Parameters
interactableForOnly returns items which are interactable for this character

Definition at line 336 of file Order.cs.

◆ GetOptionName() [1/3]

LocalizedString Barotrauma.OrderPrefab.GetOptionName ( Identifier  id)

Definition at line 375 of file Order.cs.

◆ GetOptionName() [2/3]

LocalizedString Barotrauma.OrderPrefab.GetOptionName ( int  index)

Definition at line 381 of file Order.cs.

◆ GetOptionName() [3/3]

LocalizedString Barotrauma.OrderPrefab.GetOptionName ( string  id)

Definition at line 370 of file Order.cs.

◆ GetTargetItemComponent()

ItemComponent Barotrauma.OrderPrefab.GetTargetItemComponent ( Item  item)

Get the target item component based on the target item type

Definition at line 315 of file Order.cs.

◆ GetTargetItems()

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

Definition at line 401 of file Order.cs.

◆ HasAppropriateJob()

bool Barotrauma.OrderPrefab.HasAppropriateJob ( Character  character)

◆ HasPreferredJob()

bool Barotrauma.OrderPrefab.HasPreferredJob ( Character  character)

◆ TargetItemsMatchItem() [1/2]

static bool Barotrauma.OrderPrefab.TargetItemsMatchItem ( ImmutableArray< Identifier targetItems,
Item  item 
)
static

Definition at line 420 of file Order.cs.

◆ TargetItemsMatchItem() [2/2]

bool Barotrauma.OrderPrefab.TargetItemsMatchItem ( Item  item,
Identifier  option = default 
)

Definition at line 413 of file Order.cs.

◆ TryGetTargetItemComponent()

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

Definition at line 329 of file Order.cs.

Member Data Documentation

◆ AllOptions

readonly ImmutableArray<Identifier> Barotrauma.OrderPrefab.AllOptions

Definition at line 108 of file Order.cs.

◆ AppropriateJobs

readonly ImmutableArray<Identifier> Barotrauma.OrderPrefab.AppropriateJobs

If defined, the order can only be quick-assigned to characters with these jobs. Or if it's a report, the icon will only be displayed to characters with these jobs.

Definition at line 105 of file Order.cs.

◆ AppropriateSkill

readonly Identifier Barotrauma.OrderPrefab.AppropriateSkill

Definition at line 119 of file Order.cs.

◆ AutoDismiss

readonly bool Barotrauma.OrderPrefab.AutoDismiss

Definition at line 125 of file Order.cs.

◆ CanBeGeneralized

readonly bool Barotrauma.OrderPrefab.CanBeGeneralized

Can the order be turned into a non-entity-targeting one if it was originally created with a target entity. Note: if MustSetTarget is true, CanBeGeneralized will always be false.

Definition at line 118 of file Order.cs.

◆ CanTypeBeSubclass

readonly bool Barotrauma.OrderPrefab.CanTypeBeSubclass

Definition at line 58 of file Order.cs.

◆ Category

readonly? OrderCategory Barotrauma.OrderPrefab.Category

Definition at line 46 of file Order.cs.

◆ CategoryIdentifier

readonly Identifier Barotrauma.OrderPrefab.CategoryIdentifier

Definition at line 47 of file Order.cs.

◆ ContextualName

readonly LocalizedString Barotrauma.OrderPrefab.ContextualName

Name that can be used with the contextual version of the order

Definition at line 53 of file Order.cs.

◆ ControllerTags

readonly ImmutableArray<Identifier> Barotrauma.OrderPrefab.ControllerTags

Definition at line 100 of file Order.cs.

◆ DismissalIdentifier

readonly Identifier Barotrauma.OrderPrefab.DismissalIdentifier = "dismissed".ToIdentifier()
static

Definition at line 43 of file Order.cs.

◆ FadeOutTime

readonly float Barotrauma.OrderPrefab.FadeOutTime

Definition at line 96 of file Order.cs.

◆ Hidden

readonly bool Barotrauma.OrderPrefab.Hidden

Definition at line 120 of file Order.cs.

◆ HiddenOptions

readonly ImmutableArray<Identifier> Barotrauma.OrderPrefab.HiddenOptions

Definition at line 107 of file Order.cs.

◆ IgnoreAtOutpost

readonly bool Barotrauma.OrderPrefab.IgnoreAtOutpost

Definition at line 121 of file Order.cs.

◆ ItemComponentType

readonly Type Barotrauma.OrderPrefab.ItemComponentType

Definition at line 57 of file Order.cs.

◆ MustManuallyAssign

readonly bool Barotrauma.OrderPrefab.MustManuallyAssign

Definition at line 124 of file Order.cs.

◆ MustSetTarget

readonly bool Barotrauma.OrderPrefab.MustSetTarget

Definition at line 113 of file Order.cs.

◆ Name

readonly LocalizedString Barotrauma.OrderPrefab.Name

Definition at line 49 of file Order.cs.

◆ OptionNames

readonly ListDictionary<Identifier, LocalizedString> Barotrauma.OrderPrefab.OptionNames

Definition at line 109 of file Order.cs.

◆ Options

readonly ImmutableArray<Identifier> Barotrauma.OrderPrefab.Options

Definition at line 106 of file Order.cs.

◆ OptionSprites

readonly ImmutableDictionary<Identifier, Sprite> Barotrauma.OrderPrefab.OptionSprites

Definition at line 111 of file Order.cs.

◆ Prefabs

readonly PrefabCollection<OrderPrefab> Barotrauma.OrderPrefab.Prefabs = new PrefabCollection<OrderPrefab>()
static

Definition at line 41 of file Order.cs.

◆ PreferredJobs

readonly ImmutableArray<Identifier> Barotrauma.OrderPrefab.PreferredJobs

If defined, the order will be quick-assigned to characters with these jobs before characters with other jobs.

Definition at line 130 of file Order.cs.

◆ RequireItems

readonly ImmutableArray<Identifier> Barotrauma.OrderPrefab.RequireItems

Definition at line 60 of file Order.cs.

◆ SymbolSprite

readonly Sprite Barotrauma.OrderPrefab.SymbolSprite

Definition at line 55 of file Order.cs.

◆ TargetAllCharacters

readonly bool Barotrauma.OrderPrefab.TargetAllCharacters

Definition at line 85 of file Order.cs.

◆ TargetItems

readonly ImmutableArray<Identifier> Barotrauma.OrderPrefab.TargetItems

Definition at line 59 of file Order.cs.

◆ TraitorModeOnly

bool Barotrauma.OrderPrefab.TraitorModeOnly

Definition at line 92 of file Order.cs.

◆ UseController

readonly bool Barotrauma.OrderPrefab.UseController

Definition at line 98 of file Order.cs.

Property Documentation

◆ AssignmentPriority

int Barotrauma.OrderPrefab.AssignmentPriority
get

Affects how high on the order list the order will be placed (i.e. the manual priority order when it's given) when it's first given. Manually rearranging orders will override this priority.

Definition at line 151 of file Order.cs.

◆ Color

Color Barotrauma.OrderPrefab.Color
get

Definition at line 65 of file Order.cs.

◆ ColoredWhenControllingGiver

bool Barotrauma.OrderPrefab.ColoredWhenControllingGiver
get

Definition at line 153 of file Order.cs.

◆ Dismissal

OrderPrefab Barotrauma.OrderPrefab.Dismissal
staticget

Definition at line 44 of file Order.cs.

◆ DisplayGiverInTooltip

bool Barotrauma.OrderPrefab.DisplayGiverInTooltip
get

Definition at line 154 of file Order.cs.

◆ DrawIconWhenContained

bool Barotrauma.OrderPrefab.DrawIconWhenContained
get

Should the order icon be drawn when the order target is inside a container

Definition at line 145 of file Order.cs.

◆ HasOptions

bool Barotrauma.OrderPrefab.HasOptions
get

Definition at line 123 of file Order.cs.

◆ HasOptionSpecificTargetItems

bool Barotrauma.OrderPrefab.HasOptionSpecificTargetItems
get

Definition at line 62 of file Order.cs.

◆ IsDismissal

bool Barotrauma.OrderPrefab.IsDismissal
get

Definition at line 94 of file Order.cs.

◆ IsIgnoreOrder

bool Barotrauma.OrderPrefab.IsIgnoreOrder
get

Definition at line 140 of file Order.cs.

◆ IsReport

bool Barotrauma.OrderPrefab.IsReport
get

Definition at line 86 of file Order.cs.

◆ IsVisibleAsReportButton

bool Barotrauma.OrderPrefab.IsVisibleAsReportButton
get

Definition at line 88 of file Order.cs.

◆ TargetType

OrderTargetType Barotrauma.OrderPrefab.TargetType
get

Definition at line 138 of file Order.cs.

◆ WallSectionIndex

int? Barotrauma.OrderPrefab.WallSectionIndex
get

Definition at line 139 of file Order.cs.