Class EntityLump.Entity
Namespace: ValveResourceFormat.ResourceTypes
Assembly: ValveResourceFormat.dll
Represents a single entity with its properties and connections.
public class EntityLump.Entity : KVObject, IReadOnlyDictionary<string, KVObject>, IReadOnlyCollection<KeyValuePair<string, KVObject>>, IEnumerable<KeyValuePair<string, KVObject>>, IEnumerable, IConvertibleInheritance
object ← KVObject ← EntityLump.Entity
Implements
IReadOnlyDictionary<string, KVObject>, IReadOnlyCollection<KeyValuePair<string, KVObject>>, IEnumerable<KeyValuePair<string, KVObject>>, IEnumerable, IConvertible
Inherited Members
KVObject.TryGetValue(string, out KVObject), KVObject.ContainsKey(string), KVObject.Add(string, KVObject), KVObject.TryAdd(string, KVObject), KVObject.Add(KVObject), KVObject.Remove(string), KVObject.RemoveAt(int), KVObject.Clear(), KVObject.Collection(), KVObject.Collection(int), KVObject.Collection(IEnumerable<KeyValuePair<string, KVObject>>), KVObject.ListCollection(), KVObject.ListCollection(int), KVObject.ListCollection(IEnumerable<KeyValuePair<string, KVObject>>), KVObject.Array(), KVObject.Array(int), KVObject.Array(IEnumerable<KVObject>), KVObject.PackedArray(bool[], KVFlag), KVObject.PackedArray(short[], KVFlag), KVObject.PackedArray(ushort[], KVFlag), KVObject.PackedArray(int[], KVFlag), KVObject.PackedArray(uint[], KVFlag), KVObject.PackedArray(long[], KVFlag), KVObject.PackedArray(ulong[], KVFlag), KVObject.PackedArray(float[], KVFlag), KVObject.PackedArray(double[], KVFlag), KVObject.Blob(byte[]), KVObject.Null(), KVObject.AsBlob(), KVObject.AsArraySpan(), KVObject.TryGetArraySpan<T>(out ReadOnlySpan<T>), KVObject.ToArray<T>(), KVObject.GetElement<T>(int), KVObject.ToBoolean(), KVObject.ToByte(), KVObject.ToSByte(), KVObject.ToChar(), KVObject.ToInt16(), KVObject.ToUInt16(), KVObject.ToInt32(), KVObject.ToUInt32(), KVObject.ToInt64(), KVObject.ToUInt64(), KVObject.ToSingle(), KVObject.ToDouble(), KVObject.ToDecimal(), KVObject.ToString(), KVObject.ToBoolean(IFormatProvider?), KVObject.ToByte(IFormatProvider?), KVObject.ToChar(IFormatProvider?), KVObject.ToDecimal(IFormatProvider?), KVObject.ToDouble(IFormatProvider?), KVObject.ToInt16(IFormatProvider?), KVObject.ToInt32(IFormatProvider?), KVObject.ToInt64(IFormatProvider?), KVObject.ToSByte(IFormatProvider?), KVObject.ToSingle(IFormatProvider?), KVObject.ToString(IFormatProvider?), KVObject.ToUInt16(IFormatProvider?), KVObject.ToUInt32(IFormatProvider?), KVObject.ToUInt64(IFormatProvider?), KVObject.ToType(Type, IFormatProvider?), KVObject.GetEnumerator(), KVObject.ValueType, KVObject.Flag, KVObject.IsNull, KVObject.IsArray, KVObject.IsPackedArray, KVObject.IsCollection, KVObject.Count, KVObject.this[string], KVObject.this[int], KVObject.Children, KVObject.Keys, KVObject.Values, KVObject.Elements
Extension Methods
KVObjectExtensions.GetArray(KVObject, string), KVObjectExtensions.GetArray<T>(KVObject, string), KVObjectExtensions.GetBooleanProperty(KVObject, string, bool), KVObjectExtensions.GetByteProperty(KVObject, string, byte), KVObjectExtensions.GetDoubleProperty(KVObject, string, double), KVObjectExtensions.GetEnumValue<TEnum>(KVObject, string, bool, string), KVObjectExtensions.GetFloatArray(KVObject, string), KVObjectExtensions.GetFloatProperty(KVObject, string, float), KVObjectExtensions.GetInt32Property(KVObject, string, int), KVObjectExtensions.GetIntegerArray(KVObject, string), KVObjectExtensions.GetIntegerProperty(KVObject, string, long), KVObjectExtensions.GetNullableFloatProperty(KVObject, string), KVObjectExtensions.GetNullableInt32Property(KVObject, string), KVObjectExtensions.GetParticleBooleanProperty(KVObject, string, bool), KVObjectExtensions.GetStringProperty(KVObject, string, string?), KVObjectExtensions.GetSubCollection(KVObject, string), KVObjectExtensions.GetUInt32Property(KVObject, string, uint), KVObjectExtensions.GetUnsignedIntegerArray(KVObject, string), KVObjectExtensions.GetUnsignedIntegerArray<T>(KVObject, string), KVObjectExtensions.GetUnsignedIntegerProperty(KVObject, string, ulong), KVObjectExtensions.GetVector2Property(KVObject, string, Vector2), KVObjectExtensions.GetVector3Property(KVObject, string, Vector3), KVObjectExtensions.IsNotBlobType(KVObject, string), KVObjectExtensions.ToBooleanOrDefault(KVObject, bool), KVObjectExtensions.ToColor32(KVObject), KVObjectExtensions.ToFloatOrDefault(KVObject, float), KVObjectExtensions.ToInt32OrDefault(KVObject, int), KVObjectExtensions.ToInt64OrDefault(KVObject, long), KVDocumentExtensions.ToKV3Document(KVObject, KV3ID?), KVDocumentExtensions.ToKV3String(KVObject, KV3ID?), KVObjectExtensions.ToMatrix4x4(KVObject), KVObjectExtensions.ToQuaternion(KVObject), KVObjectExtensions.ToTransform(KVObject), KVObjectExtensions.ToVector2(KVObject), KVObjectExtensions.ToVector3(KVObject), KVObjectExtensions.ToVector3OrDefault(KVObject, Vector3), KVObjectExtensions.ToVector4(KVObject)
Properties
Connections
Gets the entity connections (outputs that fire inputs on other entities, part of the entity I/O system).
public List<EntityLump.Connection>? Connections { get; }Property Value
FriendlyTargetName
Gets the target name of the entity with its name fixup markers removed, as the map spawns it.
public string? FriendlyTargetName { get; }Property Value
string?
ParentLump
Gets the parent entity lump that contains this entity.
public required EntityLump ParentLump { get; init; }Property Value
TargetName
Gets the target name of the entity.
public string? TargetName { get; }Property Value
string?
Methods
GetColor32(string, Color32)
Gets a Color32 property value.
public Color32 GetColor32(string key, Color32 defaultValue)Parameters
key string
The property name.
defaultValue Color32
The color where the property is missing.
Returns
The color, defaultValue if the property is missing, or black if it cannot be read.
GetColor32Alpha(string)
Gets the alpha of a Color32 property, normalized to 0-1.
public float GetColor32Alpha(string key)Parameters
key string
The property name.
Returns
float
The alpha, or 1 if the property has no alpha component.
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).
GetInputConnections(List<Entity>?)
Finds all connections in the parent lump that target this entity by its targetname.
public List<EntityLump.Connection> GetInputConnections(List<EntityLump.Entity>? entities)Parameters
entities List<EntityLump.Entity>?
List of world entities to look for connections for, defaults to the current lump.
Returns
A list of input connections targeting this entity.
GetRenderTint()
Gets the render tint as a colour plus alpha, from rendercolor and renderamt.
public Vector4 GetRenderTint()Returns
The tint, with each channel normalized to 0-1.

