pub struct Water {
pub points: Vec<(i32, i32)>,
pub wells: Vec<Option<usize>>,
pub blocks: Vec<Vec<i32>>,
pub size: i32,
}Expand description
The town’s water sources.
Fields§
§points: Vec<(i32, i32)>(shore cell, water cell) pairs.
wells: Vec<Option<usize>>WellComponents (a removed well leaves its slot empty).
blocks: Vec<Vec<i32>>Per 8 × 8 block, the point indices (wells as -1 - i).
size: i32Cells per map side.
Implementations§
Source§impl Water
impl Water
Sourcepub fn new(cells: &Cells) -> Water
pub fn new(cells: &Cells) -> Water
Every ground cell (type 2) next to river or lake water (types 7, 8) is a point, with the first such neighbour by rows.
Original: FUN_14008e050, FUN_1400a43f0 (scan).
Sourcepub fn add_entry(&mut self, x: i32, y: i32, v: i32)
pub fn add_entry(&mut self, x: i32, y: i32, v: i32)
Add a value to the map layer at a cell.
Original: FUN_14008df50.
Sourcepub fn add_well(&mut self, e: usize, cell: (i32, i32))
pub fn add_well(&mut self, e: usize, cell: (i32, i32))
The first empty slot, else a new one, filed under the well’s map cell.
Original: FUN_140097180.
Sourcepub fn remove_well(&mut self, e: usize, cell: (i32, i32))
pub fn remove_well(&mut self, e: usize, cell: (i32, i32))
Remove a well from the fire-fighting layer.
Original: FUN_140097070.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Water
impl RefUnwindSafe for Water
impl Send for Water
impl Sync for Water
impl Unpin for Water
impl UnsafeUnpin for Water
impl UnwindSafe for Water
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more