Struct screeps::objects::MoveToOptions
source · [−]pub struct MoveToOptions<'a, F>where
F: FnMut(RoomName, CostMatrix<'a>) -> SingleRoomCostResult<'a>,{ /* private fields */ }
Implementations
sourceimpl MoveToOptions<'static, fn(_: RoomName, _: CostMatrix<'static>) -> SingleRoomCostResult<'static>>
impl MoveToOptions<'static, fn(_: RoomName, _: CostMatrix<'static>) -> SingleRoomCostResult<'static>>
sourceimpl<'a, F> MoveToOptions<'a, F>where
F: FnMut(RoomName, CostMatrix<'a>) -> SingleRoomCostResult<'a>,
impl<'a, F> MoveToOptions<'a, F>where
F: FnMut(RoomName, CostMatrix<'a>) -> SingleRoomCostResult<'a>,
sourcepub fn reuse_path(self, n_ticks: u32) -> Self
pub fn reuse_path(self, n_ticks: u32) -> Self
Enables caching of the calculated path. Default: 5 ticks
sourcepub fn serialize_memory(self, serialize: bool) -> Self
pub fn serialize_memory(self, serialize: bool) -> Self
Whether to use the short serialized form. Default: True
sourcepub fn no_path_finding(self, no_finding: bool) -> Self
pub fn no_path_finding(self, no_finding: bool) -> Self
Return an ERR_NOT_FOUND
if no path is already cached. Default: False
sourcepub fn visualize_path_style(self, style: PolyStyle) -> Self
pub fn visualize_path_style(self, style: PolyStyle) -> Self
Sets the style to trace the path used by this creep. See doc for default.
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>(self, cost_callback: F2) -> MoveToOptions<'b, F2>where
F2: FnMut(RoomName, CostMatrix<'b>) -> SingleRoomCostResult<'b>,
pub fn cost_callback<'b, F2>(self, cost_callback: F2) -> MoveToOptions<'b, F2>where
F2: FnMut(RoomName, CostMatrix<'b>) -> SingleRoomCostResult<'b>,
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
.
sourcepub fn find_options<'b, F2>(
self,
find_options: FindOptions<'b, F2, SingleRoomCostResult<'b>>
) -> MoveToOptions<'b, F2>where
F2: FnMut(RoomName, CostMatrix<'b>) -> SingleRoomCostResult<'b>,
pub fn find_options<'b, F2>(
self,
find_options: FindOptions<'b, F2, SingleRoomCostResult<'b>>
) -> MoveToOptions<'b, F2>where
F2: FnMut(RoomName, CostMatrix<'b>) -> SingleRoomCostResult<'b>,
Sets options related to FindOptions. Defaults to FindOptions default.
Trait Implementations
sourceimpl Default for MoveToOptions<'static, fn(_: RoomName, _: CostMatrix<'static>) -> SingleRoomCostResult<'static>>
impl Default for MoveToOptions<'static, fn(_: RoomName, _: CostMatrix<'static>) -> SingleRoomCostResult<'static>>
Auto Trait Implementations
impl<'a, F> RefUnwindSafe for MoveToOptions<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for MoveToOptions<'a, F>where
F: Send,
impl<'a, F> Sync for MoveToOptions<'a, F>where
F: Sync,
impl<'a, F> Unpin for MoveToOptions<'a, F>where
F: Unpin,
impl<'a, F> UnwindSafe for MoveToOptions<'a, F>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