pub struct Pathfinder {
pub mask: u32,
/* private fields */
}Expand description
The pathfinder: the map’s cells, the cost of each cell type, and the state of the A* search.
Original: FUN_1400abcc0 (the path manager).
Fields§
§mask: u32Allowed types (command 0).
Implementations§
Source§impl Pathfinder
impl Pathfinder
Sourcepub fn new(size: usize, types: &[CellType]) -> Pathfinder
pub fn new(size: usize, types: &[CellType]) -> Pathfinder
Built from the map with diagonal steps on.
Original: FUN_1400a3d90.
Sourcepub fn set_blocked(&mut self, cell: usize, blocked: bool)
pub fn set_blocked(&mut self, cell: usize, blocked: bool)
Command 3.
Sourcepub fn set_mode(&mut self, mode: u32)
pub fn set_mode(&mut self, mode: u32)
Select a mover’s cost table and diagonal option.
Original: FUN_1400a3a20.
Sourcepub fn find_road(
&mut self,
from: i32,
to: i32,
mask: u32,
manhattan: bool,
blocked: &[bool],
) -> Option<Vec<i32>>
pub fn find_road( &mut self, from: i32, to: i32, mask: u32, manhattan: bool, blocked: &[bool], ) -> Option<Vec<i32>>
The cells of a road from one cell to another: every cell type costs 1, there are no
diagonal steps, and blocked cells and cells outside mask are avoided. blocked marks the
cells that have an occupant.
Original: FUN_1400a22d0; its search options FUN_1400abd80(0, manhattan, 1).
Sourcepub fn keeping_state<T>(
&mut self,
search: impl FnOnce(&mut Pathfinder) -> T,
) -> T
pub fn keeping_state<T>( &mut self, search: impl FnOnce(&mut Pathfinder) -> T, ) -> T
Run search and put the costs, diagonal, heuristic, blocked check and mask back.
Auto Trait Implementations§
impl Freeze for Pathfinder
impl RefUnwindSafe for Pathfinder
impl Send for Pathfinder
impl Sync for Pathfinder
impl Unpin for Pathfinder
impl UnsafeUnpin for Pathfinder
impl UnwindSafe for Pathfinder
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