pub struct SectorGraph {
pub cell_node: Vec<i32>,
/* private fields */
}Expand description
The sector graph: the map cut into 8 × 8-cell sectors, the walkable areas of each sector as nodes, and links between neighbouring areas. It gives the “path rank” distance that storage, job and resource searches use, and caches it.
Fields§
§cell_node: Vec<i32>Cell: node of each cell (-1 none).
Implementations§
Source§impl SectorGraph
impl SectorGraph
Sourcepub fn distance(
&mut self,
a: i32,
b: i32,
reachable: bool,
store: bool,
types: &[CellType],
) -> i32
pub fn distance( &mut self, a: i32, b: i32, reachable: bool, store: bool, types: &[CellType], ) -> i32
The path-rank distance from cell a to cell b, or -1 when b cannot be reached.
reachable is the caller’s region test (both cells in the same walkable region); store
keeps a computed distance in the cache.
Original: FUN_1400a4ce0.
Source§impl SectorGraph
impl SectorGraph
Sourcepub fn new(size: usize, types: &[CellType]) -> SectorGraph
pub fn new(size: usize, types: &[CellType]) -> SectorGraph
The graph of a map: every sector is built, then linked, in index order.
Original: FUN_1400adb40, then FUN_1400adf60.
Sourcepub fn mark(&mut self, x: i32, y: i32)
pub fn mark(&mut self, x: i32, y: i32)
A cell changed; rebuild its sector and relink the 3 × 3 around it.
Original: FUN_1400ae160.
Auto Trait Implementations§
impl Freeze for SectorGraph
impl RefUnwindSafe for SectorGraph
impl Send for SectorGraph
impl Sync for SectorGraph
impl Unpin for SectorGraph
impl UnsafeUnpin for SectorGraph
impl UnwindSafe for SectorGraph
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