Barotrauma Client Doc
Barotrauma.ContentXElement Class Reference

Public Member Functions

 ContentXElement (ContentPackage? contentPackage, XElement element)
 
Identifier NameAsIdentifier ()
 
ContentXElementFirstElement ()
 
bool IsOverride ()
 
bool ComesAfter (ContentXElement other)
 
ContentXElementGetChildElement (string name)
 
IEnumerable< ContentXElementElements ()
 
IEnumerable< ContentXElementElementsBeforeSelf ()
 
IEnumerable< ContentXElementDescendants ()
 
IEnumerable< ContentXElementGetChildElements (string name)
 
XAttribute? GetAttribute (string name)
 
IEnumerable< XAttribute > Attributes ()
 
IEnumerable< XAttribute > Attributes (string name)
 
string ElementInnerText ()
 
Identifier GetAttributeIdentifier (string key, string def)
 
Identifier GetAttributeIdentifier (string key, Identifier def)
 
Identifier[] GetAttributeIdentifierArray (Identifier[] def, params string[] keys)
 
Identifier[] GetAttributeIdentifierArray (string key, Identifier[] def, bool trim=true)
 
ImmutableHashSet< IdentifierGetAttributeIdentifierImmutableHashSet (string key, ImmutableHashSet< Identifier >? def, bool trim=true)
 
string? GetAttributeString (string key, string? def)
 
string GetAttributeStringUnrestricted (string key, string def)
 
string?[] GetAttributeStringArray (string key, string[]? def, bool convertToLowerInvariant=false)
 
ContentPathGetAttributeContentPath (string key)
 
int GetAttributeInt (string key, int def)
 
ushort GetAttributeUInt16 (string key, ushort def)
 
int?[] GetAttributeIntArray (string key, int[]? def)
 
ushort?[] GetAttributeUshortArray (string key, ushort[]? def)
 
float GetAttributeFloat (string key, float def)
 
float?[] GetAttributeFloatArray (string key, float[]? def)
 
float GetAttributeFloat (float def, params string[] keys)
 
bool GetAttributeBool (string key, bool def)
 
Point GetAttributePoint (string key, in Point def)
 
Vector2 GetAttributeVector2 (string key, in Vector2 def)
 
Vector4 GetAttributeVector4 (string key, in Vector4 def)
 
Color GetAttributeColor (string key, in Color def)
 
Color? GetAttributeColor (string key)
 
Color?[] GetAttributeColorArray (string key, Color[]? def)
 
Rectangle GetAttributeRect (string key, in Rectangle def)
 
Version GetAttributeVersion (string key, Version def)
 
GetAttributeEnum< T > (string key, in T def)
 
Range< int > GetAttributeRange (string key, in Range< int > def)
 
Identifier VariantOf ()
 
bool DoesAttributeReferenceFileNameAlone (string key)
 
string ParseContentPathFromUri ()
 
void SetAttributeValue (string key, string val)
 
void Add (ContentXElement elem)
 
void AddFirst (ContentXElement elem)
 
void AddAfterSelf (ContentXElement elem)
 
void Remove ()
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 

Static Public Member Functions

static implicit operator XElement? (ContentXElement? cxe)
 
static bool operator== (in ContentXElement? a, in ContentXElement? b)
 
static bool operator!= (in ContentXElement? a, in ContentXElement? b)
 

Public Attributes

readonly XElement Element
 
 T1
 

Properties

ContentPackageContentPackage [get]
 
XName Name [get]
 
string BaseUri [get]
 
XDocument? Document [get]
 
ContentXElementParent [get]
 
bool HasElements [get]
 

Detailed Description

Definition at line 12 of file ContentXElement.cs.

Constructor & Destructor Documentation

◆ ContentXElement()

Barotrauma.ContentXElement.ContentXElement ( ContentPackage contentPackage,
XElement  element 
)

Definition at line 17 of file ContentXElement.cs.

Member Function Documentation

◆ Add()

void Barotrauma.ContentXElement.Add ( ContentXElement  elem)

Definition at line 107 of file ContentXElement.cs.

◆ AddAfterSelf()

void Barotrauma.ContentXElement.AddAfterSelf ( ContentXElement  elem)

Definition at line 121 of file ContentXElement.cs.

◆ AddFirst()

void Barotrauma.ContentXElement.AddFirst ( ContentXElement  elem)

Definition at line 114 of file ContentXElement.cs.

◆ Attributes() [1/2]

IEnumerable<XAttribute> Barotrauma.ContentXElement.Attributes ( )

◆ Attributes() [2/2]

IEnumerable<XAttribute> Barotrauma.ContentXElement.Attributes ( string  name)

◆ ComesAfter()

bool Barotrauma.ContentXElement.ComesAfter ( ContentXElement  other)

◆ Descendants()

IEnumerable<ContentXElement> Barotrauma.ContentXElement.Descendants ( )

◆ DoesAttributeReferenceFileNameAlone()

bool Barotrauma.ContentXElement.DoesAttributeReferenceFileNameAlone ( string  key)

◆ ElementInnerText()

string Barotrauma.ContentXElement.ElementInnerText ( )

◆ Elements()

IEnumerable<ContentXElement> Barotrauma.ContentXElement.Elements ( )

◆ ElementsBeforeSelf()

IEnumerable<ContentXElement> Barotrauma.ContentXElement.ElementsBeforeSelf ( )

◆ Equals()

override bool Barotrauma.ContentXElement.Equals ( object?  obj)

Definition at line 130 of file ContentXElement.cs.

◆ FirstElement()

ContentXElement? Barotrauma.ContentXElement.FirstElement ( )

◆ GetAttribute()

XAttribute? Barotrauma.ContentXElement.GetAttribute ( string  name)

◆ GetAttributeBool()

bool Barotrauma.ContentXElement.GetAttributeBool ( string  key,
bool  def 
)

◆ GetAttributeColor() [1/2]

Color? Barotrauma.ContentXElement.GetAttributeColor ( string  key)

◆ GetAttributeColor() [2/2]

Color Barotrauma.ContentXElement.GetAttributeColor ( string  key,
in Color  def 
)

◆ GetAttributeColorArray()

Color? [] Barotrauma.ContentXElement.GetAttributeColorArray ( string  key,
Color?[]  def 
)

◆ GetAttributeContentPath()

ContentPath? Barotrauma.ContentXElement.GetAttributeContentPath ( string  key)

◆ GetAttributeEnum< T >()

T Barotrauma.ContentXElement.GetAttributeEnum< T > ( string  key,
in T  def 
)
Type Constraints
T :struct 
T :Enum 
T :Element.GetAttributeEnum 
T :key 
T :def 

◆ GetAttributeFloat() [1/2]

float Barotrauma.ContentXElement.GetAttributeFloat ( float  def,
params string[]  keys 
)

◆ GetAttributeFloat() [2/2]

float Barotrauma.ContentXElement.GetAttributeFloat ( string  key,
float  def 
)

◆ GetAttributeFloatArray()

float? [] Barotrauma.ContentXElement.GetAttributeFloatArray ( string  key,
float?[]  def 
)

◆ GetAttributeIdentifier() [1/2]

Identifier Barotrauma.ContentXElement.GetAttributeIdentifier ( string  key,
Identifier  def 
)

◆ GetAttributeIdentifier() [2/2]

Identifier Barotrauma.ContentXElement.GetAttributeIdentifier ( string  key,
string  def 
)

◆ GetAttributeIdentifierArray() [1/2]

Identifier [] Barotrauma.ContentXElement.GetAttributeIdentifierArray ( Identifier[]  def,
params string[]  keys 
)

◆ GetAttributeIdentifierArray() [2/2]

Identifier [] Barotrauma.ContentXElement.GetAttributeIdentifierArray ( string  key,
Identifier[]  def,
bool  trim = true 
)

◆ GetAttributeIdentifierImmutableHashSet()

ImmutableHashSet<Identifier> Barotrauma.ContentXElement.GetAttributeIdentifierImmutableHashSet ( string  key,
ImmutableHashSet< Identifier >?  def,
bool  trim = true 
)

◆ GetAttributeInt()

int Barotrauma.ContentXElement.GetAttributeInt ( string  key,
int  def 
)

◆ GetAttributeIntArray()

int? [] Barotrauma.ContentXElement.GetAttributeIntArray ( string  key,
int?[]  def 
)

◆ GetAttributePoint()

Point Barotrauma.ContentXElement.GetAttributePoint ( string  key,
in Point  def 
)

◆ GetAttributeRange()

Range<int> Barotrauma.ContentXElement.GetAttributeRange ( string  key,
in Range< int >  def 
)

◆ GetAttributeRect()

Rectangle Barotrauma.ContentXElement.GetAttributeRect ( string  key,
in Rectangle  def 
)

◆ GetAttributeString()

string? Barotrauma.ContentXElement.GetAttributeString ( string  key,
string?  def 
)

◆ GetAttributeStringArray()

string? [] Barotrauma.ContentXElement.GetAttributeStringArray ( string  key,
string?[]  def,
bool  convertToLowerInvariant = false 
)

◆ GetAttributeStringUnrestricted()

string Barotrauma.ContentXElement.GetAttributeStringUnrestricted ( string  key,
string  def 
)

◆ GetAttributeUInt16()

ushort Barotrauma.ContentXElement.GetAttributeUInt16 ( string  key,
ushort  def 
)

◆ GetAttributeUshortArray()

ushort? [] Barotrauma.ContentXElement.GetAttributeUshortArray ( string  key,
ushort?[]  def 
)

◆ GetAttributeVector2()

Vector2 Barotrauma.ContentXElement.GetAttributeVector2 ( string  key,
in Vector2  def 
)

◆ GetAttributeVector4()

Vector4 Barotrauma.ContentXElement.GetAttributeVector4 ( string  key,
in Vector4  def 
)

◆ GetAttributeVersion()

Version Barotrauma.ContentXElement.GetAttributeVersion ( string  key,
Version  def 
)

◆ GetChildElement()

ContentXElement? Barotrauma.ContentXElement.GetChildElement ( string  name)

◆ GetChildElements()

IEnumerable<ContentXElement> Barotrauma.ContentXElement.GetChildElements ( string  name)

◆ GetHashCode()

override int Barotrauma.ContentXElement.GetHashCode ( )

Definition at line 135 of file ContentXElement.cs.

◆ IsOverride()

bool Barotrauma.ContentXElement.IsOverride ( )

◆ NameAsIdentifier()

Identifier Barotrauma.ContentXElement.NameAsIdentifier ( )

◆ operator XElement?()

static implicit Barotrauma.ContentXElement.operator XElement? ( ContentXElement cxe)
static

◆ operator!=()

static bool Barotrauma.ContentXElement.operator!= ( in ContentXElement a,
in ContentXElement b 
)
static

◆ operator==()

static bool Barotrauma.ContentXElement.operator== ( in ContentXElement a,
in ContentXElement b 
)
static

Definition at line 140 of file ContentXElement.cs.

◆ ParseContentPathFromUri()

string Barotrauma.ContentXElement.ParseContentPathFromUri ( )

◆ Remove()

void Barotrauma.ContentXElement.Remove ( )

◆ SetAttributeValue()

void Barotrauma.ContentXElement.SetAttributeValue ( string  key,
string  val 
)

◆ VariantOf()

Identifier Barotrauma.ContentXElement.VariantOf ( )

Member Data Documentation

◆ Element

readonly XElement Barotrauma.ContentXElement.Element

Definition at line 15 of file ContentXElement.cs.

◆ T1

Barotrauma.ContentXElement.T1

Definition at line 95 of file ContentXElement.cs.

Property Documentation

◆ BaseUri

string Barotrauma.ContentXElement.BaseUri
get

Definition at line 29 of file ContentXElement.cs.

◆ ContentPackage

ContentPackage? Barotrauma.ContentXElement.ContentPackage
get

Definition at line 14 of file ContentXElement.cs.

◆ Document

XDocument? Barotrauma.ContentXElement.Document
get

Definition at line 31 of file ContentXElement.cs.

◆ HasElements

bool Barotrauma.ContentXElement.HasElements
get

Definition at line 36 of file ContentXElement.cs.

◆ Name

XName Barotrauma.ContentXElement.Name
get

Definition at line 26 of file ContentXElement.cs.

◆ Parent

ContentXElement? Barotrauma.ContentXElement.Parent
get

Definition at line 35 of file ContentXElement.cs.