pub struct Cells {Show 15 fields
pub size: usize,
pub types: Vec<CellType>,
pub types_revision: u64,
pub objects: Vec<Option<usize>>,
pub occupants: Vec<Option<usize>>,
pub flags: Vec<u8>,
pub previous_template: Vec<Option<usize>>,
pub growth_bytes: Vec<u8>,
pub layers: Vec<[u8; 12]>,
pub layer_totals: [i16; 12],
pub road_kind: Vec<u8>,
pub road_built: Vec<u8>,
pub road_revision: u32,
pub floors: Floors,
pub sector_marks: Vec<u32>,
}Expand description
The gameplay map cells seeding reads and writes (Game, 48-byte cells).
Fields§
§size: usizeThe map’s size in cells.
types: Vec<CellType>The type of each cell. Change it only with Cells::set_type, which keeps Cells::types_revision current.
types_revision: u64A new stamp whenever types may have changed (a new map, any set_type), so readers
such as the path regions can skip comparing the whole map when it has not.
objects: Vec<Option<usize>>Entity on the cell (index into the placed list).
occupants: Vec<Option<usize>>The entity occupying each cell, for placement checks (separate from the objects stamped into the cell).
flags: Vec<u8>Placement admission flag, deliberately unnamed.
previous_template: Vec<Option<usize>>External ComponentDescription reference from a growth transition.
growth_bytes: Vec<u8>A byte per cell that growth adjusts.
layers: Vec<[u8; 12]>Per-cell layer counters: 0..=5 the HappinessComponent kinds, 8 the fishing docks.
Original: FUN_1400a4e60.
layer_totals: [i16; 12]Map: registrations per layer.
road_kind: Vec<u8>The road kind the cell has or will have (0 stone, 1 dirt; 0xff none).
road_built: Vec<u8>The road kind built (0x80 while it is being built).
road_revision: u32Bumped whenever a road is planned, taken back or finished (the road decals’ rebuild).
Original: FUN_1400b4840.
floors: FloorsThe floors (bridge decks) that characters walk on.
sector_marks: Vec<u32>Cells that turned walkable or unwalkable, in the order they did: the path sectors’ marks, which every type write in the original makes on the spot.
Original: FUN_1400ae160.
Implementations§
Source§impl Cells
impl Cells
Sourcepub fn entity_at(&self, i: usize) -> Option<usize>
pub fn entity_at(&self, i: usize) -> Option<usize>
The entity a cell answers for, the occupant if there is one, else the object. EditTool selection, the removal tool and the job code all read cells this way.
Original: FUN_1400a5750.
Sourcepub fn new(size: usize, types: Vec<CellType>) -> Cells
pub fn new(size: usize, types: Vec<CellType>) -> Cells
The cells of a map of size × size cells with these natural types.