Struct screeps::objects::input::FindPathOptions
source · pub struct FindPathOptions<F, R>{ /* private fields */ }
Implementations§
source§impl<R> FindPathOptions<fn(_: RoomName, _: CostMatrix) -> R, R>where
R: RoomCostResult + Default,
impl<R> FindPathOptions<fn(_: RoomName, _: CostMatrix) -> R, R>where
R: RoomCostResult + Default,
source§impl<F, R> FindPathOptions<F, R>
impl<F, R> FindPathOptions<F, R>
sourcepub fn ignore_creeps(self, ignore: bool) -> Self
pub fn ignore_creeps(self, ignore: bool) -> Self
Sets whether the algorithm considers creeps as walkable. Default: False.
sourcepub fn ignore_destructible_structures(self, ignore: bool) -> Self
pub fn ignore_destructible_structures(self, ignore: bool) -> Self
Sets whether the algorithm considers destructible structure as walkable. Default: False.
sourcepub fn cost_callback<F2, R2>(self, cost_callback: F2) -> FindPathOptions<F2, R2>
pub fn cost_callback<F2, R2>(self, cost_callback: F2) -> FindPathOptions<F2, R2>
Sets cost callback - default |_, _| {}
.
sourcepub fn heuristic_weight(self, weight: f64) -> Self
pub fn heuristic_weight(self, weight: f64) -> Self
Sets heuristic weight - default 1.2
.
sourcepub fn serialize(self, s: bool) -> Self
pub fn serialize(self, s: bool) -> Self
Sets whether the returned path should be passed to Room.serializePath
.
pub fn range(self, k: u32) -> Self
sourcepub fn plain_cost(self, cost: u8) -> Self
pub fn plain_cost(self, cost: u8) -> Self
Sets plain cost - default 1
.
sourcepub fn swamp_cost(self, cost: u8) -> Self
pub fn swamp_cost(self, cost: u8) -> Self
Sets swamp cost - default 5
.
Trait Implementations§
source§impl<R> Default for FindPathOptions<fn(_: RoomName, _: CostMatrix) -> R, R>where
R: RoomCostResult + Default,
impl<R> Default for FindPathOptions<fn(_: RoomName, _: CostMatrix) -> R, R>where
R: RoomCostResult + Default,
Auto Trait Implementations§
impl<F, R> Freeze for FindPathOptions<F, R>where
F: Freeze,
impl<F, R> RefUnwindSafe for FindPathOptions<F, R>where
F: RefUnwindSafe,
impl<F, R> Send for FindPathOptions<F, R>where
F: Send,
impl<F, R> Sync for FindPathOptions<F, R>where
F: Sync,
impl<F, R> Unpin for FindPathOptions<F, R>where
F: Unpin,
impl<F, R> UnwindSafe for FindPathOptions<F, R>where
F: UnwindSafe,
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