Expand description
Building placement (PlacementTool): the footprint under the cursor, whether it may be built
and the map stamp of a footprint string. See docs/BUILD-TOOLS.md.
Original: FUN_140102ed0, FUN_1400a2a50, FUN_1400a4aa0, FUN_1400a30f0.
Structs§
- Placement
Rules - The
CreatePlacedDescriptionandMapDescriptionvalues placement reads. - Rect
- A cell rectangle, inclusive.
Constants§
- HEIGHT_
TOLERANCE - Height tolerance placement passes (effectively unlimited).
- ROTATION_
STEP - Degrees per rotation step.
Functions§
- can_
place - Whether a building can be placed: every cell of its footprint admits it. This is the test the placement tool makes.
- cell_
admits - Whether a cell admits a building: its type is in
mask, the ground is flat enough and level enough, and its occupant (if any) may be replaced. - footprint
- The footprint of a
width × heightbuilding centred oncell(even sizes extend one more cell towards +x/+y), turned byrotationsteps (1 and 3 swap the sides).Nonewhen it leaves the map (the left column must also be at least 1). - footprint_
cell - One cell of a footprint, as the placement test and the overlay test it: whether it admits the
building (with the cell’s mask), and whether its footprint character is
.(the cell is not changed, and its zone count is not checked). - footprint_
index - Index into a footprint string (rows separated by one character, last row first) of cell
(i, j)of aw × hrectangle placed withdegreesrotation (w,hare the rotated sides). - stamp
- Stamp a footprint.
#and an empty footprint set the building’s type,_sets ground (2); every cell except.records the entity. - zone
- Activate a zone: the entity becomes the occupant of every footprint cell that is not
., and each.cell counts one more zone. Not ported: the path grid’s blocked bit (citizens’ mode 0 does not honour it).