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

Public Member Functions

 StructurePrefab (ContentXElement element, StructureFile file)
 
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)
 

Public Attributes

readonly ContentXElement ConfigElement
 
readonly? bool IsHorizontal
 If null, the orientation is determined automatically based on the dimensions of the structure instances More...
 
readonly Sprite BackgroundSprite
 
- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 

Static Public Attributes

static readonly PrefabCollection< StructurePrefabPrefabs = new PrefabCollection<StructurePrefab>()
 
- 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)
 

Protected Attributes

Vector2 textureScale = Vector2.One
 

Properties

override LocalizedString Name [get]
 
override bool CanSpriteFlipX [get]
 
override bool CanSpriteFlipY [get]
 
Vector2 ScaledSize [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]
 
bool Body [get]
 
float BodyRotation [get]
 
float BodyWidth [get]
 
float BodyHeight [get]
 
Vector2 BodyOffset [get]
 
bool Platform [get]
 
bool AllowAttachItems [get]
 
bool AllowRotatingInEditor [get, set]
 
float MinHealth [get]
 
float Health [get]
 
bool IndestructibleInOutposts [get]
 
bool CastShadow [get]
 
Direction StairDirection [get]
 
float StairAngle [get]
 
bool NoAITarget [get]
 
Vector2 Size [get]
 
string DamageSound [get]
 
string DamageParticle [get]
 
Vector2 TextureScale [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 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 ()
 
- Static Protected Attributes inherited from Barotrauma.MapEntityPrefab
static Vector2 placePosition
 

Detailed Description

Definition at line 16 of file StructurePrefab.cs.

Constructor & Destructor Documentation

◆ StructurePrefab()

Barotrauma.StructurePrefab.StructurePrefab ( ContentXElement  element,
StructureFile  file 
)

Definition at line 136 of file StructurePrefab.cs.

Member Function Documentation

◆ CreateInstance()

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

Implements Barotrauma.MapEntityPrefab.

Definition at line 321 of file StructurePrefab.cs.

◆ DetermineIdentifier()

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

Reimplemented from Barotrauma.Prefab.

Definition at line 121 of file StructurePrefab.cs.

◆ Dispose()

override void Barotrauma.StructurePrefab.Dispose ( )
virtual

Implements Barotrauma.Prefab.

Definition at line 326 of file StructurePrefab.cs.

Member Data Documentation

◆ BackgroundSprite

readonly Sprite Barotrauma.StructurePrefab.BackgroundSprite

Definition at line 34 of file StructurePrefab.cs.

◆ ConfigElement

readonly ContentXElement Barotrauma.StructurePrefab.ConfigElement

Definition at line 22 of file StructurePrefab.cs.

◆ IsHorizontal

readonly? bool Barotrauma.StructurePrefab.IsHorizontal

If null, the orientation is determined automatically based on the dimensions of the structure instances

Definition at line 30 of file StructurePrefab.cs.

◆ Prefabs

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

Definition at line 18 of file StructurePrefab.cs.

◆ textureScale

Vector2 Barotrauma.StructurePrefab.textureScale = Vector2.One
protected

Definition at line 108 of file StructurePrefab.cs.

Property Documentation

◆ Aliases

override ImmutableHashSet<string> Barotrauma.StructurePrefab.Aliases
get

Definition at line 46 of file StructurePrefab.cs.

◆ AllowAttachItems

bool Barotrauma.StructurePrefab.AllowAttachItems
get

Definition at line 68 of file StructurePrefab.cs.

◆ AllowedLinks

override ImmutableHashSet<Identifier> Barotrauma.StructurePrefab.AllowedLinks
get

Definition at line 42 of file StructurePrefab.cs.

◆ AllowRotatingInEditor

bool Barotrauma.StructurePrefab.AllowRotatingInEditor
getset

Definition at line 71 of file StructurePrefab.cs.

◆ Body

bool Barotrauma.StructurePrefab.Body
get

Definition at line 49 of file StructurePrefab.cs.

◆ BodyHeight

float Barotrauma.StructurePrefab.BodyHeight
get

Definition at line 58 of file StructurePrefab.cs.

◆ BodyOffset

Vector2 Barotrauma.StructurePrefab.BodyOffset
get

Definition at line 62 of file StructurePrefab.cs.

◆ BodyRotation

float Barotrauma.StructurePrefab.BodyRotation
get

Definition at line 52 of file StructurePrefab.cs.

◆ BodyWidth

float Barotrauma.StructurePrefab.BodyWidth
get

Definition at line 55 of file StructurePrefab.cs.

◆ CanSpriteFlipX

override bool Barotrauma.StructurePrefab.CanSpriteFlipX
get

Definition at line 24 of file StructurePrefab.cs.

◆ CanSpriteFlipY

override bool Barotrauma.StructurePrefab.CanSpriteFlipY
get

Definition at line 25 of file StructurePrefab.cs.

◆ CastShadow

bool Barotrauma.StructurePrefab.CastShadow
get

Definition at line 88 of file StructurePrefab.cs.

◆ Category

override MapEntityCategory Barotrauma.StructurePrefab.Category
get

Definition at line 44 of file StructurePrefab.cs.

◆ DamageParticle

string Barotrauma.StructurePrefab.DamageParticle
get

Definition at line 106 of file StructurePrefab.cs.

◆ DamageSound

string Barotrauma.StructurePrefab.DamageSound
get

Definition at line 103 of file StructurePrefab.cs.

◆ Health

float Barotrauma.StructurePrefab.Health
get

Definition at line 78 of file StructurePrefab.cs.

◆ IndestructibleInOutposts

bool Barotrauma.StructurePrefab.IndestructibleInOutposts
get

Definition at line 85 of file StructurePrefab.cs.

◆ MinHealth

float Barotrauma.StructurePrefab.MinHealth
get

Definition at line 74 of file StructurePrefab.cs.

◆ Name

override LocalizedString Barotrauma.StructurePrefab.Name
get

Definition at line 20 of file StructurePrefab.cs.

◆ NoAITarget

bool Barotrauma.StructurePrefab.NoAITarget
get

Definition at line 97 of file StructurePrefab.cs.

◆ OriginalName

override string Barotrauma.StructurePrefab.OriginalName
get

Definition at line 38 of file StructurePrefab.cs.

◆ Platform

bool Barotrauma.StructurePrefab.Platform
get

Definition at line 65 of file StructurePrefab.cs.

◆ ScaledSize

Vector2 Barotrauma.StructurePrefab.ScaledSize
get

Definition at line 32 of file StructurePrefab.cs.

◆ Size

Vector2 Barotrauma.StructurePrefab.Size
get

Definition at line 100 of file StructurePrefab.cs.

◆ Sprite

override Sprite Barotrauma.StructurePrefab.Sprite
get

Definition at line 36 of file StructurePrefab.cs.

◆ StairAngle

float Barotrauma.StructurePrefab.StairAngle
get

Definition at line 94 of file StructurePrefab.cs.

◆ StairDirection

Direction Barotrauma.StructurePrefab.StairDirection
get

Definition at line 91 of file StructurePrefab.cs.

◆ Tags

override ImmutableHashSet<Identifier> Barotrauma.StructurePrefab.Tags
get

Definition at line 40 of file StructurePrefab.cs.

◆ TextureScale

Vector2 Barotrauma.StructurePrefab.TextureScale
get

Definition at line 110 of file StructurePrefab.cs.