people
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
people
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.life.people — who is in the city, and where. The registry the crowd lives in. The `Crowd` component writes it every frame and `game.memory` reads it to answer who was standing close enough to see something: `Memory.adopt(People.all())` publishes the whole crowd as witnesses, and because these are the SAME tables the component moves, a position written here is the position the memory tests against. Kept apart from the component so a later slice can ask the city who is around without reaching into whatever is standing them up.
nameFor(n: number) → string
A stable name for the nth person in a district. Same n, same name.
| arg | type | description |
|---|---|---|
| n | number | number |
set(person: any) → any
Put somebody in the registry, or move them if they are already in it.
| arg | type | description |
|---|---|---|
| person | any | table { id, name, district, x, z } |
remove(id: string) → void
Take somebody out of the registry.
| arg | type | description |
|---|---|---|
| id | string | string |
all( ) →
Everybody in the city right now.
count( ) → number
How many people are in the city.
get(id: string) → any
One person, or nil.
| arg | type | description |
|---|---|---|
| id | string | string |
nearest(x: number, z: number, radius: number) → any
The closest person to a point, within a radius.
| arg | type | description |
|---|---|---|
| x | number | number |
| z | number | number |
| radius | number | number |
byDistrict( ) →
How many people are standing in each district.
clear( ) → void
Forget everyone. Used when the crowd is rebuilt.
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.