Barotrauma Server Doc
Barotrauma.ItemAssemblyPrefab Class Reference
Inheritance diagram for Barotrauma.ItemAssemblyPrefab:
Barotrauma.MapEntityPrefab Barotrauma.PrefabWithUintIdentifier Barotrauma.Prefab

Public Member Functions

 ItemAssemblyPrefab (ContentXElement element, ItemAssemblyFile file)
 
List< MapEntityCreateInstance (Vector2 position, Submarine sub, bool selectInstance=false)
 
void Delete ()
 
override void Dispose ()
 
- Public Member Functions inherited from Barotrauma.MapEntityPrefab
 MapEntityPrefab (ContentXElement element, ContentFile file)
 
string GetItemNameTextId ()
 
string GetHullNameTextId ()
 
IEnumerable< IdentifierGetAllowedUpgrades ()
 
bool HasSubCategory (string subcategory)
 
bool NameMatches (string name, StringComparison comparisonType)
 Check if the name or any of the aliases of this prefab match the given name. More...
 
bool NameMatches (IEnumerable< string > allowedNames, StringComparison comparisonType)
 
bool IsLinkAllowed (MapEntityPrefab target)
 
- Public Member Functions inherited from Barotrauma.Prefab
 Prefab (ContentFile file, Identifier identifier)
 
 Prefab (ContentFile file, ContentXElement element)
 

Static Public Member Functions

static List< MapEntityPasteEntities (Vector2 position, Submarine sub, XElement configElement, string filePath=null, bool selectInstance=false)
 
- Static Public Member Functions inherited from Barotrauma.MapEntityPrefab
static bool SelectPrefab (object selection)
 
static object GetSelected ()
 
static MapEntityPrefab Find (string name, string identifier=null, bool showErrorMessages=true)
 Find a matching map entity prefab More...
 
static MapEntityPrefab Find (string name, Identifier identifier, bool showErrorMessages=true)
 
static MapEntityPrefab GetRandom (Predicate< MapEntityPrefab > predicate, Rand.RandSync sync)
 
static MapEntityPrefab Find (Predicate< MapEntityPrefab > predicate)
 Find a matching map entity prefab More...
 
static MapEntityPrefab FindByName (string name)
 
static MapEntityPrefab FindByIdentifier (Identifier identifier)
 
- Static Public Member Functions inherited from Barotrauma.Prefab
static void DisallowCallFromConstructor ()
 

Public Attributes

readonly ImmutableArray<(Identifier Identifier, Rectangle Rect)> DisplayEntities
 
readonly Rectangle Bounds
 
- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 

Static Public Attributes

static readonly PrefabCollection< ItemAssemblyPrefabPrefabs = new PrefabCollection<ItemAssemblyPrefab>()
 
- Static Public Attributes inherited from Barotrauma.Prefab
static readonly ImmutableHashSet< Type > Types
 

Protected Member Functions

override Identifier DetermineIdentifier (XElement element)
 
override void CreateInstance (Rectangle rect)
 
- Protected Member Functions inherited from Barotrauma.MapEntityPrefab
 MapEntityPrefab (Identifier identifier)
 
void LoadDescription (ContentXElement element)
 
- Protected Member Functions inherited from Barotrauma.PrefabWithUintIdentifier
 PrefabWithUintIdentifier (ContentFile file, Identifier identifier)
 
 PrefabWithUintIdentifier (ContentFile file, ContentXElement element)
 

Properties

override LocalizedString Name [get]
 
override Sprite Sprite [get]
 
override string OriginalName [get]
 
override ImmutableHashSet< IdentifierTags [get]
 
override ImmutableHashSet< IdentifierAllowedLinks [get]
 
override MapEntityCategory Category [get]
 
override ImmutableHashSet< string > Aliases [get]
 
- Properties inherited from Barotrauma.MapEntityPrefab
static IEnumerable< MapEntityPrefabList [get]
 
static MapEntityPrefab Selected [get, set]
 
abstract Sprite Sprite [get]
 
virtual bool CanSpriteFlipX = false [get]
 
virtual bool CanSpriteFlipY = false [get]
 
abstract string OriginalName [get]
 
abstract LocalizedString Name [get]
 
abstract ImmutableHashSet< IdentifierTags [get]
 
abstract ImmutableHashSet< IdentifierAllowedLinks [get]
 Links defined to identifiers. More...
 
abstract MapEntityCategory Category [get]
 
abstract ImmutableHashSet< string > Aliases [get]
 
bool ResizeHorizontal [get, protected set]
 
bool ResizeVertical [get, protected set]
 
LocalizedString Description [get, protected set]
 
string AllowedUpgrades [get, protected set]
 
bool HideInMenus [get, protected set]
 
bool HideInEditors [get, protected set]
 
string Subcategory [get, protected set]
 
bool Linkable [get, protected set]
 
Color SpriteColor [get, protected set]
 
float Scale [get, protected set]
 
- Properties inherited from Barotrauma.PrefabWithUintIdentifier
UInt32 UintIdentifier [get, set]
 
- Properties inherited from Barotrauma.Prefab
ContentPackageContentPackage [get]
 
ContentPath FilePath [get]
 

Additional Inherited Members

- Static Protected Attributes inherited from Barotrauma.MapEntityPrefab
static Vector2 placePosition
 

Detailed Description

Definition at line 14 of file ItemAssemblyPrefab.cs.

Constructor & Destructor Documentation

◆ ItemAssemblyPrefab()

Barotrauma.ItemAssemblyPrefab.ItemAssemblyPrefab ( ContentXElement  element,
ItemAssemblyFile  file 
)

Definition at line 43 of file ItemAssemblyPrefab.cs.

Member Function Documentation

◆ CreateInstance() [1/2]

override void Barotrauma.ItemAssemblyPrefab.CreateInstance ( Rectangle  rect)
protectedvirtual

Implements Barotrauma.MapEntityPrefab.

Definition at line 109 of file ItemAssemblyPrefab.cs.

◆ CreateInstance() [2/2]

List<MapEntity> Barotrauma.ItemAssemblyPrefab.CreateInstance ( Vector2  position,
Submarine  sub,
bool  selectInstance = false 
)

Definition at line 122 of file ItemAssemblyPrefab.cs.

◆ Delete()

void Barotrauma.ItemAssemblyPrefab.Delete ( )

Definition at line 164 of file ItemAssemblyPrefab.cs.

◆ DetermineIdentifier()

override Identifier Barotrauma.ItemAssemblyPrefab.DetermineIdentifier ( XElement  element)
protectedvirtual

Reimplemented from Barotrauma.Prefab.

Definition at line 38 of file ItemAssemblyPrefab.cs.

◆ Dispose()

override void Barotrauma.ItemAssemblyPrefab.Dispose ( )
virtual

Implements Barotrauma.Prefab.

Definition at line 183 of file ItemAssemblyPrefab.cs.

◆ PasteEntities()

static List<MapEntity> Barotrauma.ItemAssemblyPrefab.PasteEntities ( Vector2  position,
Submarine  sub,
XElement  configElement,
string  filePath = null,
bool  selectInstance = false 
)
static

Definition at line 127 of file ItemAssemblyPrefab.cs.

Member Data Documentation

◆ Bounds

readonly Rectangle Barotrauma.ItemAssemblyPrefab.Bounds

Definition at line 22 of file ItemAssemblyPrefab.cs.

◆ DisplayEntities

readonly ImmutableArray<(Identifier Identifier, Rectangle Rect)> Barotrauma.ItemAssemblyPrefab.DisplayEntities

Definition at line 20 of file ItemAssemblyPrefab.cs.

◆ Prefabs

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

Definition at line 16 of file ItemAssemblyPrefab.cs.

Property Documentation

◆ Aliases

override ImmutableHashSet<string> Barotrauma.ItemAssemblyPrefab.Aliases
get

Definition at line 36 of file ItemAssemblyPrefab.cs.

◆ AllowedLinks

override ImmutableHashSet<Identifier> Barotrauma.ItemAssemblyPrefab.AllowedLinks
get

Definition at line 32 of file ItemAssemblyPrefab.cs.

◆ Category

override MapEntityCategory Barotrauma.ItemAssemblyPrefab.Category
get

Definition at line 34 of file ItemAssemblyPrefab.cs.

◆ Name

override LocalizedString Barotrauma.ItemAssemblyPrefab.Name
get

Definition at line 24 of file ItemAssemblyPrefab.cs.

◆ OriginalName

override string Barotrauma.ItemAssemblyPrefab.OriginalName
get

Definition at line 28 of file ItemAssemblyPrefab.cs.

◆ Sprite

override Sprite Barotrauma.ItemAssemblyPrefab.Sprite
get

Definition at line 26 of file ItemAssemblyPrefab.cs.

◆ Tags

override ImmutableHashSet<Identifier> Barotrauma.ItemAssemblyPrefab.Tags
get

Definition at line 30 of file ItemAssemblyPrefab.cs.