Struct screeps::objects::FindOptions
source · [−]pub struct FindOptions<'a, F, R>where
F: FnMut(RoomName, CostMatrix<'a>) -> R,
R: RoomCostResult,{ /* private fields */ }
Implementations
sourceimpl<'a, R> FindOptions<'a, fn(_: RoomName, _: CostMatrix<'a>) -> R, R>where
R: RoomCostResult + Default,
impl<'a, R> FindOptions<'a, fn(_: RoomName, _: CostMatrix<'a>) -> R, R>where
R: RoomCostResult + Default,
sourceimpl<'a, F, R> FindOptions<'a, F, R>where
F: FnMut(RoomName, CostMatrix<'a>) -> R,
R: RoomCostResult,
impl<'a, F, R> FindOptions<'a, F, R>where
F: FnMut(RoomName, CostMatrix<'a>) -> R,
R: RoomCostResult,
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<'b, F2, R2>(
self,
cost_callback: F2
) -> FindOptions<'b, F2, R2>where
F2: FnMut(RoomName, CostMatrix<'b>) -> R2,
R2: RoomCostResult,
pub fn cost_callback<'b, F2, R2>(
self,
cost_callback: F2
) -> FindOptions<'b, F2, R2>where
F2: FnMut(RoomName, CostMatrix<'b>) -> R2,
R2: RoomCostResult,
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
sourceimpl<'a, R> Default for FindOptions<'a, fn(_: RoomName, _: CostMatrix<'a>) -> R, R>where
R: RoomCostResult + Default,
impl<'a, R> Default for FindOptions<'a, fn(_: RoomName, _: CostMatrix<'a>) -> R, R>where
R: RoomCostResult + Default,
Auto Trait Implementations
impl<'a, F, R> RefUnwindSafe for FindOptions<'a, F, R>where
F: RefUnwindSafe,
impl<'a, F, R> Send for FindOptions<'a, F, R>where
F: Send,
impl<'a, F, R> Sync for FindOptions<'a, F, R>where
F: Sync,
impl<'a, F, R> Unpin for FindOptions<'a, F, R>where
F: Unpin,
impl<'a, F, R> UnwindSafe for FindOptions<'a, F, R>where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, U> IntoExpectedType<U> for Twhere
U: FromExpectedType<T>,
impl<T, U> IntoExpectedType<U> for Twhere
U: FromExpectedType<T>,
sourcefn into_expected_type(self) -> Result<U, ConversionError>
fn into_expected_type(self) -> Result<U, ConversionError>
Casts this value as the target type, making the assumption that the types are correct. Read more