Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 0a0b119f-a…

districtState

What the city remembers: each district's colour and vigilance, the

byzero-proxy @ DESKTOP-DB3UJOJ·posted 11d ago
What it does

districtState

What the city remembers: each district's colour and vigilance, the

signed walls in it, how its people feel, and which walls the scrub crews come for.

  local DistrictState = require("metropolisGame.logic.districtState")
  local ds = DistrictState.new(Districts, PaintContent.sizes, Economy, hub?)
  ds:signed("oldquay", "fishmarket", "piece", "clean", day)     -- a wall was signed (or re-signed better)
  ds:lost("oldquay", "fishmarket")                              -- scrubbed away
  ds:colour("oldquay") -> 0..100       ds:vigilance("oldquay") -> 0..3      ds:isPainted("oldquay")
  ds:incident("oldquay", peakLevel)    -- an incident ended there; Wanted or worse raises vigilance
  ds:paint("oldquay")                  -- its landmark was signed: the district is painted
  ds:dayPassed(day) -> { { district, vigilance } }   quiet districts cool; returns the ones that changed
  ds:citizens("oldquay") -> { informer, sympathiser }   shares of passers-by, turned by colour
  ds:decayFactor("oldquay") -> number  -- how fast heat cools there (1.5 at colour 50 and over)
  ds:scrubTargets("oldquay") -> { site, ... }   the walls tomorrow's crews will come for, in order
  ds:paintedCount() -> number          ds:walls("oldquay") -> { [site] = { size, tier, day } }
  ds:view("oldquay") -> { id, colour, vigilance, painted, signed, thresholds = { tags, door, landmark } }
  ds:quiet(days)                       -- no scrub crews anywhere for that many days (Dry Tank)
  ds:serialise()   ds:restore(data)

Hub events: "colour" { district, value, delta }, "threshold" { district, name }, "vigilance" { district, value,
delta }, "districtPainted" { district }.

The interface is documented in the header of init.luau; this file repeats it for the asset browser.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

metropolisGame.logic.districtState — what the city remembers: each district's colour and vigilance, the signed walls in it, how its people feel, and which walls the scrub crews come for. local DistrictState = require("metropolisGame.logic.districtState") local ds = DistrictState.new(Districts, PaintContent.sizes, Economy, hub?) ds:signed("oldquay", "fishmarket", "piece", "clean", day) -- a wall was signed (or re-signed better) ds:lost("oldquay", "fishmarket") -- scrubbed away ds:colour("oldquay") -> 0..100 ds:vigilance("oldquay") -> 0..3 ds:isPainted("oldquay") ds:incident("oldquay", peakLevel) -- an incident ended there; Wanted or worse raises vigilance ds:paint("oldquay") -- its landmark was signed: the district is painted ds:dayPassed(day) -> { { district, vigilance } } quiet districts cool; returns the ones that changed ds:citizens("oldquay") -> { informer, sympathiser } shares of passers-by, turned by colour ds:decayFactor("oldquay") -> number -- how fast heat cools there (1.5 at colour 50 and over) ds:scrubTargets("oldquay") -> { site, ... } the walls tomorrow's crews will come for, in order ds:paintedCount() -> number ds:walls("oldquay") -> { [site] = { size, tier, day } } ds:view("oldquay") -> { id, colour, vigilance, painted, signed, thresholds = { tags, door, landmark } } ds:quiet(days) -- no scrub crews anywhere for that many days (Dry Tank) ds:serialise() ds:restore(data) Hub events: "colour" { district, value, delta }, "threshold" { district, name }, "vigilance" { district, value, delta }, "districtPainted" { district }.

new(districts: any, sizes: any, economy: any, hub: any?) → any

argtypedescription
districtsany
sizesany
economyany
hubany?

emit(self: any, name: string, payload: any) → void

argtypedescription
selfany
namestring
payloadany

points(self: any, size: string, tier: string) → number

argtypedescription
selfany
sizestring
tierstring

colour(id: string) → number

A district's colour, 0..100.

argtypedescription
idstring

recolour(self: any, id: string, before: number) → void

argtypedescription
selfany
idstring
beforenumber

signed(id: string, site: string, size: string, tier: string, day: number) → boolean

A wall was signed. Signing the same wall again only counts if it is better.

argtypedescription
idstring
sitestring
sizestring
tierstring
daynumber

lost(id: string, site: string) → boolean

A wall was scrubbed away.

argtypedescription
idstring
sitestring

sympathy(id: string, pointsAdded: number) → void

Colour from something that is not a wall (a festival, a parade).

argtypedescription
idstring
pointsAddednumber

walls(id: string) → any

argtypedescription
idstring

vigilance(id: string) → number

argtypedescription
idstring

isPainted(id: string) → boolean

argtypedescription
idstring

paintedCount( ) → number

setVigilance(self: any, id: string, value: number) → void

argtypedescription
selfany
idstring
valuenumber

incident(id: string, peakLevel: number) → void

An incident ended in a district at this peak heat level (0-based). Wanted (2) or worse raises vigilance.

argtypedescription
idstring
peakLevelnumber

alarm(id: string, delta: number) → void

Raise or lower vigilance directly (a mission's consequence).

argtypedescription
idstring
deltanumber

paint(id: string) → void

The district's landmark was signed.

argtypedescription
idstring

dayPassed( ) → void

A day ended. Districts without an incident that day lose a point of vigilance. Returns what changed.

quiet(days: number) → void

No scrub crews anywhere for this many days.

argtypedescription
daysnumber

citizens(id: string) → any

Shares of passers-by who report and who cheer, at the district's present colour.

argtypedescription
idstring

decayFactor(id: string) → number

How fast heat cools in a district.

argtypedescription
idstring

scrubTargets(id: string) → void

The walls tomorrow's crews will come for: one per vigilance point, oldest Rough first, then Clean. Masterworks are never chosen where the district's colour has opened its door. A painted district has no crews.

argtypedescription
idstring

view(id: string) → any

One district for the map and the HUD banner.

argtypedescription
idstring

serialise( ) → any

restore(data: any) → void

argtypedescription
dataany

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.