Expand description
The simulation context jobs and construction run in: Sim implements the job manager’s
work slots (WorkHost) and the building state callbacks (Callbacks), over the
citizens, the map, the storages and the construction state. See docs/JOBS.md.
This file holds the context’s state and a few free helpers; its methods are split by topic:
geometry: cells, ground heights, reachability and work points;orders: a building’s workers and the actions given to citizens;sites: building sites and buildings, marking them on the map, destroying them;building: carrying materials to a site and building it;clearing: clearing an area before building;piles: loose piles of goods on the ground;storage: picking up goods, finding a storage, dropping off, emptying a storage;callbacksandwork_host: the two trait implementations.
Structs§
- Env
- The world the citizens’ update borrows (everything but the citizens themselves).
- Sim
- Everything a work slot or a state callback touches.
Constants§
- CONSTRUCTION_
MASK 0x2001: the construction works’ registration mask (category 13).
Functions§
- animating
MapComponent::IsAnimatingper placed entity.- cell_
ground - The ground at a cell’s centre, on the terrain only (bridge floors are skipped).
- clear_
remaining - The amount still to clear in an entity’s area, over a grid of
n × ncells that maps each cell to its object. - floor_
ground - The ground at a cell’s centre: on a bridge’s floor where one covers the cell above the terrain, else on the terrain.
- pile_
mask - A pile’s work category mask from its material’s flags.