Documentation
¶
Overview ¶
Package entitylump reads the entities a compiled Source 2 map stores.
A map's world resource, maps/<map>/world.vwrld_c, lists its entity lumps in m_entityLumps. Each lump is a compiled resource whose DATA block holds KeyValues3 with m_entityKeyValues, one entry per entity whose keyValues3Data.values are its keyvalues, and m_childLumps, the lumps nested under it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lumps ¶
Lumps returns the compiled resource names of the entity lumps a world's decoded DATA block lists. The world names each lump without its _c.
func Number ¶
Number returns an entity keyvalue as a number. Lumps store many numbers as text and flags as booleans; a value that is neither reads as 0.
func Walk ¶
func Walk(read func(name string) ([]byte, error), name string, visit func(values map[string]any)) error
Walk calls visit with the keyvalues of each entity in the lump named name and in its child lumps, depth first, in stored order. read returns a compiled resource's bytes by name. A lump that cannot be read or decoded adds nothing and Walk goes on to the next; Walk returns the first such error, so a caller that needs every entity can refuse a partial walk.
Types ¶
This section is empty.