Barotrauma Server Doc
Barotrauma.MapEntityPrefab Class Referenceabstract
Inheritance diagram for Barotrauma.MapEntityPrefab:
Barotrauma.PrefabWithUintIdentifier Barotrauma.Prefab Barotrauma.CoreEntityPrefab Barotrauma.ItemAssemblyPrefab Barotrauma.ItemPrefab Barotrauma.LinkedSubmarinePrefab Barotrauma.StructurePrefab

Public Member Functions

 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)
 
abstract void Dispose ()
 

Static Public Member Functions

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 ()
 

Protected Member Functions

 MapEntityPrefab (Identifier identifier)
 
abstract void CreateInstance (Rectangle rect)
 
void LoadDescription (ContentXElement element)
 
- 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)
 

Static Protected Attributes

static Vector2 placePosition
 

Properties

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

- Public Attributes inherited from Barotrauma.Prefab
readonly Identifier Identifier
 
readonly ContentFile ContentFile
 
- Static Public Attributes inherited from Barotrauma.Prefab
static readonly ImmutableHashSet< Type > Types
 

Detailed Description

Definition at line 31 of file MapEntityPrefab.cs.

Constructor & Destructor Documentation

◆ MapEntityPrefab() [1/2]

Barotrauma.MapEntityPrefab.MapEntityPrefab ( Identifier  identifier)
protected

Definition at line 239 of file MapEntityPrefab.cs.

◆ MapEntityPrefab() [2/2]

Barotrauma.MapEntityPrefab.MapEntityPrefab ( ContentXElement  element,
ContentFile  file 
)

Definition at line 241 of file MapEntityPrefab.cs.

Member Function Documentation

◆ CreateInstance()

abstract void Barotrauma.MapEntityPrefab.CreateInstance ( Rectangle  rect)
protectedpure virtual

◆ Find() [1/3]

static MapEntityPrefab Barotrauma.MapEntityPrefab.Find ( Predicate< MapEntityPrefab predicate)
static

Find a matching map entity prefab

Parameters
predicateA predicate that returns true on the desired prefab.

Definition at line 151 of file MapEntityPrefab.cs.

◆ Find() [2/3]

static MapEntityPrefab Barotrauma.MapEntityPrefab.Find ( string  name,
Identifier  identifier,
bool  showErrorMessages = true 
)
static

Definition at line 96 of file MapEntityPrefab.cs.

◆ Find() [3/3]

static MapEntityPrefab Barotrauma.MapEntityPrefab.Find ( string  name,
string  identifier = null,
bool  showErrorMessages = true 
)
static

Find a matching map entity prefab

Parameters
nameThe name of the item (can be omitted when searching based on identifier)
identifierThe identifier of the item (if null, the identifier is ignored and the search is done only based on the name)

Definition at line 90 of file MapEntityPrefab.cs.

◆ FindByIdentifier()

static MapEntityPrefab Barotrauma.MapEntityPrefab.FindByIdentifier ( Identifier  identifier)
static

◆ FindByName()

static MapEntityPrefab Barotrauma.MapEntityPrefab.FindByName ( string  name)
static

Definition at line 157 of file MapEntityPrefab.cs.

◆ GetAllowedUpgrades()

IEnumerable<Identifier> Barotrauma.MapEntityPrefab.GetAllowedUpgrades ( )

Definition at line 257 of file MapEntityPrefab.cs.

◆ GetHullNameTextId()

string Barotrauma.MapEntityPrefab.GetHullNameTextId ( )

Definition at line 249 of file MapEntityPrefab.cs.

◆ GetItemNameTextId()

string Barotrauma.MapEntityPrefab.GetItemNameTextId ( )

Definition at line 243 of file MapEntityPrefab.cs.

◆ GetRandom()

static MapEntityPrefab Barotrauma.MapEntityPrefab.GetRandom ( Predicate< MapEntityPrefab predicate,
Rand.RandSync  sync 
)
static

Definition at line 142 of file MapEntityPrefab.cs.

◆ GetSelected()

static object Barotrauma.MapEntityPrefab.GetSelected ( )
static

Definition at line 79 of file MapEntityPrefab.cs.

◆ HasSubCategory()

bool Barotrauma.MapEntityPrefab.HasSubCategory ( string  subcategory)

Definition at line 269 of file MapEntityPrefab.cs.

◆ IsLinkAllowed()

bool Barotrauma.MapEntityPrefab.IsLinkAllowed ( MapEntityPrefab  target)

Definition at line 291 of file MapEntityPrefab.cs.

◆ LoadDescription()

void Barotrauma.MapEntityPrefab.LoadDescription ( ContentXElement  element)
protected

Definition at line 302 of file MapEntityPrefab.cs.

◆ NameMatches() [1/2]

bool Barotrauma.MapEntityPrefab.NameMatches ( IEnumerable< string >  allowedNames,
StringComparison  comparisonType 
)

◆ NameMatches() [2/2]

bool Barotrauma.MapEntityPrefab.NameMatches ( string  name,
StringComparison  comparisonType 
)

Check if the name or any of the aliases of this prefab match the given name.

◆ SelectPrefab()

static bool Barotrauma.MapEntityPrefab.SelectPrefab ( object  selection)
static

Definition at line 65 of file MapEntityPrefab.cs.

Member Data Documentation

◆ placePosition

Vector2 Barotrauma.MapEntityPrefab.placePosition
staticprotected

Definition at line 63 of file MapEntityPrefab.cs.

Property Documentation

◆ Aliases

abstract ImmutableHashSet<string> Barotrauma.MapEntityPrefab.Aliases
get

Definition at line 206 of file MapEntityPrefab.cs.

◆ AllowedLinks

abstract ImmutableHashSet<Identifier> Barotrauma.MapEntityPrefab.AllowedLinks
get

Links defined to identifiers.

Definition at line 200 of file MapEntityPrefab.cs.

◆ AllowedUpgrades

string Barotrauma.MapEntityPrefab.AllowedUpgrades
getprotected set

Definition at line 219 of file MapEntityPrefab.cs.

◆ CanSpriteFlipX

virtual bool Barotrauma.MapEntityPrefab.CanSpriteFlipX = false
get

Definition at line 188 of file MapEntityPrefab.cs.

◆ CanSpriteFlipY

virtual bool Barotrauma.MapEntityPrefab.CanSpriteFlipY = false
get

Definition at line 189 of file MapEntityPrefab.cs.

◆ Category

abstract MapEntityCategory Barotrauma.MapEntityPrefab.Category
get

Definition at line 202 of file MapEntityPrefab.cs.

◆ Description

LocalizedString Barotrauma.MapEntityPrefab.Description
getprotected set

Definition at line 216 of file MapEntityPrefab.cs.

◆ HideInEditors

bool Barotrauma.MapEntityPrefab.HideInEditors
getprotected set

Definition at line 225 of file MapEntityPrefab.cs.

◆ HideInMenus

bool Barotrauma.MapEntityPrefab.HideInMenus
getprotected set

Definition at line 222 of file MapEntityPrefab.cs.

◆ Linkable

bool Barotrauma.MapEntityPrefab.Linkable
getprotected set

Definition at line 231 of file MapEntityPrefab.cs.

◆ List

IEnumerable<MapEntityPrefab> Barotrauma.MapEntityPrefab.List
staticget

Definition at line 33 of file MapEntityPrefab.cs.

◆ Name

abstract LocalizedString Barotrauma.MapEntityPrefab.Name
get

Definition at line 193 of file MapEntityPrefab.cs.

◆ OriginalName

abstract string Barotrauma.MapEntityPrefab.OriginalName
get

Definition at line 191 of file MapEntityPrefab.cs.

◆ ResizeHorizontal

bool Barotrauma.MapEntityPrefab.ResizeHorizontal
getprotected set

Definition at line 210 of file MapEntityPrefab.cs.

◆ ResizeVertical

bool Barotrauma.MapEntityPrefab.ResizeVertical
getprotected set

Definition at line 213 of file MapEntityPrefab.cs.

◆ Scale

float Barotrauma.MapEntityPrefab.Scale
getprotected set

Definition at line 237 of file MapEntityPrefab.cs.

◆ Selected

MapEntityPrefab Barotrauma.MapEntityPrefab.Selected
staticgetset

Definition at line 60 of file MapEntityPrefab.cs.

◆ Sprite

abstract Sprite Barotrauma.MapEntityPrefab.Sprite
get

Definition at line 186 of file MapEntityPrefab.cs.

◆ SpriteColor

Color Barotrauma.MapEntityPrefab.SpriteColor
getprotected set

Definition at line 234 of file MapEntityPrefab.cs.

◆ Subcategory

string Barotrauma.MapEntityPrefab.Subcategory
getprotected set

Definition at line 228 of file MapEntityPrefab.cs.

◆ Tags

abstract ImmutableHashSet<Identifier> Barotrauma.MapEntityPrefab.Tags
get

Definition at line 195 of file MapEntityPrefab.cs.