Class EntityLump.Entity
Namespace: ValveResourceFormat.ResourceTypes
Assembly: ValveResourceFormat.dll
Represents a single entity with its properties and connections.
public class EntityLump.EntityInheritance
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 required 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
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
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
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
The property value or the default (with ) 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 : structParameters
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.
GetVector2Property(string, Vector2)
Gets a Vector2 property value by name.
public Vector2 GetVector2Property(string name, Vector2 defaultValue = default)Parameters
name string
The property name.
defaultValue Vector2
The default value to return if the property is not found.
Returns
The Vector2 property value or the default value.
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
The Vector3 property value or the default value.

