Barotrauma Client Doc
Barotrauma.ContentFile Class Referenceabstract

Base class for content file types, which are loaded from filelist.xml via reflection. PLEASE AVOID INHERITING FROM THIS CLASS DIRECTLY. Inheriting from GenericPrefabFile<T> is likely what you want. More...

Inheritance diagram for Barotrauma.ContentFile:
Barotrauma.AfflictionsFile Barotrauma.BaseSubFile Barotrauma.CharacterFile Barotrauma.DecalsFile Barotrauma.GenericPrefabFile< T > Barotrauma.HashlessFile Barotrauma.JobsFile Barotrauma.LevelGenerationParametersFile Barotrauma.MapGenerationParametersFile Barotrauma.NPCConversationsFile Barotrauma.OrdersFile Barotrauma.RandomEventsFile Barotrauma.SkillSettingsFile Barotrauma.TextFile

Classes

class  TypeInfo
 

Public Member Functions

abstract void LoadFile ()
 
abstract void UnloadFile ()
 
abstract void Sort ()
 
virtual void Preload (Action< Sprite > addPreloadedSprite)
 
virtual Md5Hash CalculateHash ()
 

Static Public Member Functions

static bool IsLegacyContentType (XElement contentFileElement, ContentPackage package, bool logWarning)
 
static Result< ContentFile, ContentPackage.LoadErrorCreateFromXElement (ContentPackage contentPackage, XElement element)
 

Public Attributes

readonly ContentPackage ContentPackage
 
readonly ContentPath Path
 
readonly Md5Hash Hash
 

Static Public Attributes

static readonly ImmutableHashSet< TypeInfoTypes
 

Protected Member Functions

 ContentFile (ContentPackage contentPackage, ContentPath path)
 

Properties

bool NotSyncedInMultiplayer [get]
 

Detailed Description

Base class for content file types, which are loaded from filelist.xml via reflection. PLEASE AVOID INHERITING FROM THIS CLASS DIRECTLY. Inheriting from GenericPrefabFile<T> is likely what you want.

Definition at line 22 of file ContentFile.cs.

Constructor & Destructor Documentation

◆ ContentFile()

Barotrauma.ContentFile.ContentFile ( ContentPackage  contentPackage,
ContentPath  path 
)
protected

Definition at line 129 of file ContentFile.cs.

Member Function Documentation

◆ CalculateHash()

virtual Md5Hash Barotrauma.ContentFile.CalculateHash ( )
virtual

Reimplemented in Barotrauma.BaseSubFile, and Barotrauma.HashlessFile.

Definition at line 145 of file ContentFile.cs.

◆ CreateFromXElement()

static Result<ContentFile, ContentPackage.LoadError> Barotrauma.ContentFile.CreateFromXElement ( ContentPackage  contentPackage,
XElement  element 
)
static

Definition at line 87 of file ContentFile.cs.

◆ IsLegacyContentType()

static bool Barotrauma.ContentFile.IsLegacyContentType ( XElement  contentFileElement,
ContentPackage  package,
bool  logWarning 
)
static

Definition at line 70 of file ContentFile.cs.

◆ LoadFile()

◆ Preload()

virtual void Barotrauma.ContentFile.Preload ( Action< Sprite addPreloadedSprite)
virtual

Reimplemented in Barotrauma.CharacterFile.

Definition at line 143 of file ContentFile.cs.

◆ Sort()

◆ UnloadFile()

Member Data Documentation

◆ ContentPackage

readonly ContentPackage Barotrauma.ContentFile.ContentPackage

Definition at line 136 of file ContentFile.cs.

◆ Hash

readonly Md5Hash Barotrauma.ContentFile.Hash

Definition at line 138 of file ContentFile.cs.

◆ Path

readonly ContentPath Barotrauma.ContentFile.Path

Definition at line 137 of file ContentFile.cs.

◆ Types

readonly ImmutableHashSet<TypeInfo> Barotrauma.ContentFile.Types
static

Definition at line 62 of file ContentFile.cs.

Property Documentation

◆ NotSyncedInMultiplayer

bool Barotrauma.ContentFile.NotSyncedInMultiplayer
get

Definition at line 150 of file ContentFile.cs.