Class EntityLump
Namespace: ValveResourceFormat.ResourceTypes
Assembly: ValveResourceFormat.dll
Represents an entity lump resource containing entity definitions and their properties.
public class EntityLump : KeyValuesOrNTROInheritance
object ← Block ← KeyValuesOrNTRO ← EntityLump
Inherited Members
KeyValuesOrNTRO.Type, KeyValuesOrNTRO.Data, KeyValuesOrNTRO.Format, KeyValuesOrNTRO.Read(BinaryReader), KeyValuesOrNTRO.Serialize(Stream), KeyValuesOrNTRO.WriteText(IndentedTextWriter), Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Fields
LocalNameFixupMarker
The marker a compiled name carries where its spawn group's local fixup goes, such as the suffix that tells apart the entities each spawn of a template makes.
public const string LocalNameFixupMarker = "&0000"Field Value
string
ParentNameFixupMarker
The marker a compiled name carries where its spawn group's parent fixup goes, such as the prefix that tells apart the instances of a prefab.
public const string ParentNameFixupMarker = "[PR#]"Field Value
string
Properties
Name
Gets the name of this entity lump.
public string Name { get; }Property Value
string
Methods
ApplyNameFixup(string, string, string)
Replaces the first EntityLump.ParentNameFixupMarker and the first EntityLump.LocalNameFixupMarker in a compiled name, applied to every name an entity is spawned with.
public static string ApplyNameFixup(string name, string parentFixup, string localFixup)Parameters
name string
A name as compiled, such as a targetname or a connection's target.
parentFixup string
What replaces EntityLump.ParentNameFixupMarker.
localFixup string
What replaces EntityLump.LocalNameFixupMarker.
Returns
string
The name with its markers replaced, or name when it has none.
EntityNameMatches(string, string)
Compares an entity targetname against a target string that may contain wildcards. Letters compare ignoring ASCII case only, and there is no escape character.
public static bool EntityNameMatches(string pattern, string targetName)Parameters
pattern string
Targetname to match against, may contain wildcards: * and ? (e.g. door_*).
targetName string
Entity targetname.
Returns
bool
Whether the targetname matches.
GetChildEntityNames()
Gets the names of child entity lumps.
public string[] GetChildEntityNames()Returns
string[]
An array of child entity lump names.
GetEntities()
Gets all entities contained in this entity lump.
public List<EntityLump.Entity> GetEntities()Returns
A list of entities.
StringifyValue(object?)
Return a string representation of an entity property.
public static string StringifyValue(object? value)Parameters
value object?
Entity property.
Returns
string
Stringified value.
ToEntityDumpString()
Converts the entity lump to a human-readable string representation.
public string ToEntityDumpString()Returns
string
A formatted string containing all entities and their properties.
ToForgeGameData()
Converts the entity lump to a Forge Game Data (FGD) format string.
public string ToForgeGameData()Returns
string
An FGD-formatted string containing entity class definitions.

