Anvil
Anvil.API.GffResourceField Class Reference

A property/field in a GffResource. More...

+ Inheritance diagram for Anvil.API.GffResourceField:

Public Member Functions

virtual bool ContainsKey (string key)
 If this field is a GffResourceFieldStruct, determines if the specified key exists in the structure. More...
 
sealed override? string ToString ()
 
virtual bool TryGetValue (string key, [NotNullWhen(true)] out GffResourceField? value)
 If this field is a GffResourceFieldStruct, gets the value associated with the specified key. More...
 
object? Value ()
 Gets the value of this field. More...
 
T? Value< T > ()
 Gets the value of this field. More...
 
object? ValueOrDefault ()
 Gets the value of this field. More...
 
T? ValueOrDefault< T > ()
 Gets the value of this field. More...
 

Static Public Member Functions

static operator byte (GffResourceField field)
 
static operator double (GffResourceField field)
 
static operator float (GffResourceField field)
 
static operator int (GffResourceField field)
 
static operator long (GffResourceField field)
 
static operator short (GffResourceField field)
 
static operator string? (GffResourceField field)
 
static operator uint (GffResourceField field)
 
static operator ulong (GffResourceField field)
 
static operator ushort (GffResourceField field)
 

Protected Member Functions

 GffResourceField (CResGFF resGff)
 
virtual bool GetValueInternal (out object? value, Type? requestedType=null)
 

Protected Attributes

readonly CResGFF ResGff
 

Properties

virtual int Count [get]
 Gets the number of child fields. More...
 
virtual IEnumerable< KeyValuePair< string, GffResourceField > > EntrySet = Enumerable.Empty<KeyValuePair<string, GffResourceField>>() [get]
 If this field is a struct, gets an enumerable of the key/values pairs.
Otherwise, returns an empty enumerable. More...
 
abstract GffResourceFieldType FieldType [get]
 Gets the GFF field type. More...
 
bool HasChildren [get]
 Gets whether this field contains child values. More...
 
virtual IEnumerable< string > Keys = Enumerable.Empty<string>() [get]
 If this field is a struct, gets an enumerable of the struct's keys.
Otherwise, returns an empty enumerable. More...
 
virtual GffResourceField this[int index] [get]
 Gets the child GffResourceField at the specified index. More...
 
virtual GffResourceField this[string key] [get]
 Gets the child GffResourceField with the specified key. More...
 
virtual IEnumerable< GffResourceFieldValues = Enumerable.Empty<GffResourceField>() [get]
 If this field is an array, gets an enumerable of the array's values.
If this field is a struct, gets an enumerable of the struct's values.
Otherwise, returns an empty enumerable. More...
 

Detailed Description

A property/field in a GffResource.

Member Function Documentation

◆ ContainsKey()

virtual bool Anvil.API.GffResourceField.ContainsKey ( string  key)
inlinevirtual

If this field is a GffResourceFieldStruct, determines if the specified key exists in the structure.

Parameters
keyThe key to locate in the GffResourceFieldStruct./
Returns
True if the field is a GffResourceFieldStruct and the key exists. Otherwise, false.

Reimplemented in Anvil.API.GffResourceFieldStruct.

◆ TryGetValue()

virtual bool Anvil.API.GffResourceField.TryGetValue ( string  key,
[NotNullWhen(true)] out GffResourceField value 
)
inlinevirtual

If this field is a GffResourceFieldStruct, gets the value associated with the specified key.

Parameters
keyThe key of the value to get./
valueIf the method runs successfully (returns true), this output parameter will contain the associated value.
Returns
True if the field is a GffResourceFieldStruct and the key exists. Otherwise, false.

Reimplemented in Anvil.API.GffResourceFieldStruct.

◆ Value()

object? Anvil.API.GffResourceField.Value ( )
inline

Gets the value of this field.

Returns
The value associated with this GffResourceField.
Exceptions
InvalidOperationExceptionThrown if this field is not a standard value type.

◆ Value< T >()

Gets the value of this field.

Template Parameters
TThe field value type.
Returns
The value associated with this GffResourceField.
Exceptions
InvalidOperationExceptionThrown if this field is not a standard value type, or an invalid generic type was specified..

◆ ValueOrDefault()

object? Anvil.API.GffResourceField.ValueOrDefault ( )
inline

Gets the value of this field.

Returns
The value associated with this GffResourceField. Returns null if the value is a list or struct.

◆ ValueOrDefault< T >()

Gets the value of this field.

Returns
The value associated with this GffResourceField. Returns null if the value is a list or struct, or does not match the specified type.

Property Documentation

◆ Count

virtual int Anvil.API.GffResourceField.Count
get

Gets the number of child fields.

◆ EntrySet

virtual IEnumerable<KeyValuePair<string, GffResourceField> > Anvil.API.GffResourceField.EntrySet = Enumerable.Empty<KeyValuePair<string, GffResourceField>>()
get

If this field is a struct, gets an enumerable of the key/values pairs.
Otherwise, returns an empty enumerable.

◆ FieldType

abstract GffResourceFieldType Anvil.API.GffResourceField.FieldType
get

Gets the GFF field type.

◆ HasChildren

bool Anvil.API.GffResourceField.HasChildren
get

Gets whether this field contains child values.

◆ Keys

virtual IEnumerable<string> Anvil.API.GffResourceField.Keys = Enumerable.Empty<string>()
get

If this field is a struct, gets an enumerable of the struct's keys.
Otherwise, returns an empty enumerable.

◆ this[int index]

virtual GffResourceField Anvil.API.GffResourceField.this[int index]
get

Gets the child GffResourceField at the specified index.

◆ this[string key]

virtual GffResourceField Anvil.API.GffResourceField.this[string key]
get

Gets the child GffResourceField with the specified key.

◆ Values

virtual IEnumerable<GffResourceField> Anvil.API.GffResourceField.Values = Enumerable.Empty<GffResourceField>()
get

If this field is an array, gets an enumerable of the array's values.
If this field is a struct, gets an enumerable of the struct's values.
Otherwise, returns an empty enumerable.


The documentation for this class was generated from the following file: