pub struct MoveToOptions<F>{ /* private fields */ }

Implementations§

source§

impl MoveToOptions<fn(_: RoomName, _: CostMatrix) -> SingleRoomCostResult>

source

pub fn new() -> Self

Creates default SearchOptions

source§

impl<F> MoveToOptions<F>

source

pub fn reuse_path(self, n_ticks: u32) -> Self

Enables caching of the calculated path. Default: 5 ticks

source

pub fn serialize_memory(self, serialize: bool) -> Self

Whether to use the short serialized form. Default: True

source

pub fn no_path_finding(self, no_finding: bool) -> Self

Return an ERR_NOT_FOUND if no path is already cached. Default: False

source

pub fn visualize_path_style(self, style: PolyStyle) -> Self

Sets the style to trace the path used by this creep. See doc for default.

source

pub fn ignore_creeps(self, ignore: bool) -> Self

Sets whether the algorithm considers creeps as walkable. Default: False.

source

pub fn ignore_destructible_structures(self, ignore: bool) -> Self

Sets whether the algorithm considers destructible structure as walkable. Default: False.

source

pub fn cost_callback<F2>(self, cost_callback: F2) -> MoveToOptions<F2>

Sets cost callback - default |_, _| {}.

source

pub fn max_ops(self, ops: u32) -> Self

Sets maximum ops - default 2000.

source

pub fn heuristic_weight(self, weight: f64) -> Self

Sets heuristic weight - default 1.2.

source

pub fn serialize(self, s: bool) -> Self

Sets whether the returned path should be passed to Room.serializePath.

source

pub fn max_rooms(self, rooms: u8) -> Self

Sets maximum rooms - default 16, max 16.

source

pub fn range(self, k: u32) -> Self

source

pub fn plain_cost(self, cost: u8) -> Self

Sets plain cost - default 1.

source

pub fn swamp_cost(self, cost: u8) -> Self

Sets swamp cost - default 5.

source

pub fn find_path_options<F2>( self, find_path_options: FindPathOptions<F2, SingleRoomCostResult> ) -> MoveToOptions<F2>

Sets options related to FindPathOptions. Defaults to FindPathOptions default.

Trait Implementations§

source§

impl Default for MoveToOptions<fn(_: RoomName, _: CostMatrix) -> SingleRoomCostResult>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for MoveToOptions<F>
where F: RefUnwindSafe,

§

impl<F> Send for MoveToOptions<F>
where F: Send,

§

impl<F> Sync for MoveToOptions<F>
where F: Sync,

§

impl<F> Unpin for MoveToOptions<F>
where F: Unpin,

§

impl<F> UnwindSafe for MoveToOptions<F>
where F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.