townKitTests.testSuite
Checks townKit's city-builder rules without real wallets or saved towns: bare plots stay empty under classic rules and fill under relaxed ones; covered homes climb to manor only when unlocked and supplied, and fall back when a need goes; townhouses wait for bread; harsh taxes ear…
townKitTests
Checks townKit's city-builder rules without real wallets or saved towns: bare plots stay empty under classic rules and fill under relaxed ones; covered homes climb to manor only when unlocked and supplied, and fall back when a need goes; townhouses wait for bread; harsh taxes earn more and cost happiness; idle rules never empty a home; workers staff production; the ladder ranks up and unlocks what it lists; offline catch-up is capped; every ladder, rule set, starter, display and drawing exists and builds. Run it in edit mode: tools.use("tests", "run", { suite = "townKitTests" }).
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2townKit's city-builder rules without the engine around them: a plot with no services stays empty under classic rules and fills under relaxed ones; covered homes climb hut -> cottage -> townhouse -> manor only once their tier is unlocked and its needs are met, and lose a tier when a need goes away; harsh taxes earn more and make people unhappier; the pure idle rules never let anyone leave; bread is eaten and missing bread holds townhouses back; workers staff production buildings; the town climbs its ladder and each rank unlocks what it lists; offline time is caught up to the cap; every ladder, rule set, starter, status display and mood display is there and builds.
town(n: number, cover: { [string]: number }?, rules: string?, ladder: string?, rank: number?) → void
a town with `n` homes and a coverage table { need = value } every home gets
| arg | type | description |
|---|---|---|
| n | number | |
| cover | { [string]: number }? | |
| rules | string? | |
| ladder | string? | |
| rank | number? |
coverage(_id: ?, need: ?) → void
| arg | type | description |
|---|---|---|
| _id | ? | |
| need | ? |
run(t: any, ctx: any, seconds: number, step: number?) → any
| arg | type | description |
|---|---|---|
| t | any | |
| ctx | any | |
| seconds | number | |
| step | number? |
coverage(_id: ?, need: ?) → void
| arg | type | description |
|---|---|---|
| _id | ? | |
| need | ? |
builder( ) → void
add(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
box(role: ?, x: ?, y: ?, z: ?, sx: ?, sy: ?, sz: ?, rot: ?) → void
| arg | type | description |
|---|---|---|
| role | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| sx | ? | |
| sy | ? | |
| sz | ? | |
| rot | ? |
cyl(role: ?, x: ?, y: ?, z: ?, d: ?, h: ?, rot: ?) → void
| arg | type | description |
|---|---|---|
| role | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| d | ? | |
| h | ? | |
| rot | ? |
sphere(role: ?, x: ?, y: ?, z: ?, sx: ?, sy: ?, sz: ?, rot: ?) → void
| arg | type | description |
|---|---|---|
| role | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| sx | ? | |
| sy | ? | |
| sz | ? | |
| rot | ? |
cone(role: ?, x: ?, y: ?, z: ?, sx: ?, sy: ?, sz: ?, rot: ?) → void
| arg | type | description |
|---|---|---|
| role | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| sx | ? | |
| sy | ? | |
| sz | ? | |
| rot | ? |
logX(role: ?, x: ?, y: ?, z: ?, d: ?, l: ?) → void
| arg | type | description |
|---|---|---|
| role | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| d | ? | |
| l | ? |
logZ(role: ?, x: ?, y: ?, z: ?, d: ?, l: ?) → void
| arg | type | description |
|---|---|---|
| role | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| d | ? | |
| l | ? |
strut(role: ?, a: ?, c: ?, w: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| role | ? | |
| a | ? | |
| c | ? | |
| w | ? | |
| t | ? |
trim(p: ?) → void
| arg | type | description |
|---|---|---|
| p | ? |
deepCopy(v: any) → any
| arg | type | description |
|---|---|---|
| v | any |
sharedStore( ) → any
get(k: string) → void
| arg | type | description |
|---|---|---|
| k | string |
set(k: string, v: any) → void
| arg | type | description |
|---|---|---|
| k | string | |
| v | any |
hostEnv(store: any, clock: any, wallets: any, present: { string }, homes: { any }) → any
| arg | type | description |
|---|---|---|
| store | any | |
| clock | any | |
| wallets | any | |
| present | { string } | |
| homes | { any } |
now( ) → void
houses( ) → void
presentKeys( ) → void
pay(key: string, n: number) → void
| arg | type | description |
|---|---|---|
| key | string | |
| n | number |
rules( ) → void
ladder( ) → void
unlocked(rank: number) → void
| arg | type | description |
|---|---|---|
| rank | number |
coverage( ) → void
bread( ) → void
jobs( ) → void
takeBread( ) → void
setStaffing( ) → void
emit( ) → void
homesList(n: number) → void
| arg | type | description |
|---|---|---|
| n | number |
play(clock: any, seconds: number) → void
| arg | type | description |
|---|---|---|
| clock | any | |
| seconds | number |
popOf(t: any) → number
| arg | type | description |
|---|---|---|
| t | any |
ladder( ) → void
unlocked(rank: number) → void
| arg | type | description |
|---|---|---|
| rank | number |
ceiling( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
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.