pub struct TownView<'a> {
pub size: usize,
pub types: &'a [CellType],
pub regions: &'a [u16],
pub occupants: &'a [Option<usize>],
pub objects: &'a [Option<usize>],
pub floors: &'a Floors,
pub entities: &'a [EntityView],
pub happiness: &'a [usize],
}Expand description
The map and entities activities read.
Fields§
§size: usizeThe map’s size in cells.
types: &'a [CellType]The type of each cell.
regions: &'a [u16]The walkable region of each cell.
occupants: &'a [Option<usize>]The occupant of each cell.
objects: &'a [Option<usize>]The object on each cell.
floors: &'a FloorsThe bridges’ floors (and the floor scene), for the ground under a point.
entities: &'a [EntityView]A view of each entity.
happiness: &'a [usize]The town manager’s HappinessComponent registry (Game).
Implementations§
Source§impl TownView<'_>
impl TownView<'_>
Sourcepub fn reachable(&self, mask: u32, a: i32, b: i32) -> bool
pub fn reachable(&self, mask: u32, a: i32, b: i32) -> bool
Can a walker with mask get from a to b (water types skip the region test)?
Original: FUN_1400a55c0.
Sourcepub fn entrance(&self, entity: usize, rng: &mut Random) -> i32
pub fn entrance(&self, entity: usize, rng: &mut Random) -> i32
The cell a citizen walks to at an entity: its first use point (the original draws
Rand(count) when there are several, but always takes point 0), else the centre of its map
rectangle.
Original: FUN_14008d480(entity, 0).
Sourcepub fn point_cell(&self, entity: usize) -> i32
pub fn point_cell(&self, entity: usize) -> i32
Interact::PointPosition(entity, 0) as a cell (no draw): the first use point, else
the map rectangle’s centre.
Auto Trait Implementations§
impl<'a> Freeze for TownView<'a>
impl<'a> RefUnwindSafe for TownView<'a>
impl<'a> Send for TownView<'a>
impl<'a> Sync for TownView<'a>
impl<'a> Unpin for TownView<'a>
impl<'a> UnsafeUnpin for TownView<'a>
impl<'a> UnwindSafe for TownView<'a>
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