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

Public Member Functions

 StructurePrefab (ContentXElement element, StructureFile file)
 
override void Dispose ()
 
override void UpdatePlacing (Camera cam)
 
override void DrawPlacing (SpriteBatch spriteBatch, Camera cam)
 
override void DrawPlacing (SpriteBatch spriteBatch, Rectangle placeRect, float scale=1.0f, float rotation=0.0f, SpriteEffects spriteEffects=SpriteEffects.None)
 
- 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)
 
void DrawListLine (SpriteBatch spriteBatch, Vector2 pos, Color color)
 
- 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
 
readonly Color BackgroundSpriteColor
 
readonly ImmutableArray< DecorativeSpriteDecorativeSprites
 
readonly ImmutableDictionary< int, ImmutableArray< DecorativeSprite > > DecorativeSpriteGroups
 
- 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

Constructor & Destructor Documentation

◆ StructurePrefab()

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

Member Function Documentation

◆ CreateInstance()

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

◆ DetermineIdentifier()

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

Reimplemented from Barotrauma.Prefab.

Definition at line 121 of file BarotraumaShared/SharedSource/Map/StructurePrefab.cs.

◆ Dispose()

override void Barotrauma.StructurePrefab.Dispose ( )
virtual

◆ DrawPlacing() [1/2]

override void Barotrauma.StructurePrefab.DrawPlacing ( SpriteBatch  spriteBatch,
Camera  cam 
)
virtual

◆ DrawPlacing() [2/2]

override void Barotrauma.StructurePrefab.DrawPlacing ( SpriteBatch  spriteBatch,
Rectangle  placeRect,
float  scale = 1.0f,
float  rotation = 0.0f,
SpriteEffects  spriteEffects = SpriteEffects.None 
)
virtual

◆ UpdatePlacing()

override void Barotrauma.StructurePrefab.UpdatePlacing ( Camera  cam)
virtual

Member Data Documentation

◆ BackgroundSprite

readonly Sprite Barotrauma.StructurePrefab.BackgroundSprite

◆ BackgroundSpriteColor

readonly Color Barotrauma.StructurePrefab.BackgroundSpriteColor

◆ ConfigElement

readonly ContentXElement Barotrauma.StructurePrefab.ConfigElement

◆ DecorativeSpriteGroups

readonly ImmutableDictionary<int, ImmutableArray<DecorativeSprite> > Barotrauma.StructurePrefab.DecorativeSpriteGroups

◆ DecorativeSprites

readonly ImmutableArray<DecorativeSprite> Barotrauma.StructurePrefab.DecorativeSprites

◆ 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 BarotraumaShared/SharedSource/Map/StructurePrefab.cs.

◆ Prefabs

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

◆ textureScale

Vector2 Barotrauma.StructurePrefab.textureScale = Vector2.One
protected

Property Documentation

◆ Aliases

override ImmutableHashSet<string> Barotrauma.StructurePrefab.Aliases
get

◆ AllowAttachItems

bool Barotrauma.StructurePrefab.AllowAttachItems
get

◆ AllowedLinks

override ImmutableHashSet<Identifier> Barotrauma.StructurePrefab.AllowedLinks
get

◆ AllowRotatingInEditor

bool Barotrauma.StructurePrefab.AllowRotatingInEditor
getset

◆ Body

bool Barotrauma.StructurePrefab.Body
get

◆ BodyHeight

float Barotrauma.StructurePrefab.BodyHeight
get

◆ BodyOffset

Vector2 Barotrauma.StructurePrefab.BodyOffset
get

◆ BodyRotation

float Barotrauma.StructurePrefab.BodyRotation
get

◆ BodyWidth

float Barotrauma.StructurePrefab.BodyWidth
get

◆ CanSpriteFlipX

override bool Barotrauma.StructurePrefab.CanSpriteFlipX
get

◆ CanSpriteFlipY

override bool Barotrauma.StructurePrefab.CanSpriteFlipY
get

◆ CastShadow

bool Barotrauma.StructurePrefab.CastShadow
get

◆ Category

override MapEntityCategory Barotrauma.StructurePrefab.Category
get

◆ DamageParticle

string Barotrauma.StructurePrefab.DamageParticle
get

◆ DamageSound

string Barotrauma.StructurePrefab.DamageSound
get

◆ Health

float Barotrauma.StructurePrefab.Health
get

◆ IndestructibleInOutposts

bool Barotrauma.StructurePrefab.IndestructibleInOutposts
get

◆ MinHealth

float Barotrauma.StructurePrefab.MinHealth
get

◆ Name

override LocalizedString Barotrauma.StructurePrefab.Name
get

◆ NoAITarget

bool Barotrauma.StructurePrefab.NoAITarget
get

◆ OriginalName

override string Barotrauma.StructurePrefab.OriginalName
get

◆ Platform

bool Barotrauma.StructurePrefab.Platform
get

◆ ScaledSize

Vector2 Barotrauma.StructurePrefab.ScaledSize
get

◆ Size

Vector2 Barotrauma.StructurePrefab.Size
get

◆ Sprite

override Sprite Barotrauma.StructurePrefab.Sprite
get

◆ StairAngle

float Barotrauma.StructurePrefab.StairAngle
get

◆ StairDirection

Direction Barotrauma.StructurePrefab.StairDirection
get

◆ Tags

override ImmutableHashSet<Identifier> Barotrauma.StructurePrefab.Tags
get

◆ TextureScale

Vector2 Barotrauma.StructurePrefab.TextureScale
get