Class EntityLump.Entity
- Namespace
- ValveResourceFormat.ResourceTypes
- Assembly
- ValveResourceFormat.dll
Represents a single entity with its properties and connections.
public class EntityLump.Entity
Inheritance
Inherited Members
Properties
Connections
Gets or sets the entity connections (inputs/outputs).
public List<KVObject> Connections { get; }
Property Value
ParentLump
Gets or initializes the parent entity lump that contains this entity.
public EntityLump ParentLump { get; init; }
Property Value
Properties
Gets the entity properties collection.
public KVObject Properties { get; }
Property Value
Methods
ContainsKey(string)
Determines whether the entity contains a property with the specified name.
public bool ContainsKey(string name)
Parameters
name
string-
The property name to check.
Returns
- bool
-
True if the property exists, false otherwise.
GetColor32Property(string)
Gets a Color32 property value as a normalized Vector3 (0-1 range).
public Vector3 GetColor32Property(string key)
Parameters
key
string-
The property name.
Returns
- Vector3
-
The normalized color vector (0-1 range).
GetProperty<T>(string, T)
Gets a strongly-typed property value by name, returning a default value if not found or on error.
public T GetProperty<T>(string name, T defaultValue = default)
Parameters
name
string-
The property name.
defaultValue
T-
The default value to return if the property is not found or conversion fails.
Returns
- T
-
The property value or the default value.
Type Parameters
T
-
The type to convert the property value to.
Exceptions
- InvalidOperationException
-
Thrown when attempting to use Vector3 type (use GetVector3Property instead).
GetProperty(string)
Gets a property value by name.
public KVValue GetProperty(string name)
Parameters
name
string-
The property name.
Returns
- KVValue
-
The property value or the default ValveResourceFormat.Serialization.KeyValues.KVValue (with ValveKeyValue.KVValueType.Null) if not found.
GetPropertyUnchecked<T>(string, T)
Gets a strongly-typed struct property value by name without type checking.
public T GetPropertyUnchecked<T>(string name, T defaultValue = default) where T : struct
Parameters
name
string-
The property name.
defaultValue
T-
The default value to return if the property is not found.
Returns
- T
-
The property value or the default value.
Type Parameters
T
-
The struct type to convert the property value to.
GetVector3Property(string, Vector3)
Gets a Vector3 property value by name.
public Vector3 GetVector3Property(string name, Vector3 defaultValue = default)
Parameters
name
string-
The property name.
defaultValue
Vector3-
The default value to return if the property is not found.
Returns
- Vector3
-
The Vector3 property value or the default value.