pub struct FindPathOptions<F, R>{ /* private fields */ }

Implementations§

source§

impl<R> FindPathOptions<fn(_: RoomName, _: CostMatrix) -> R, R>

source

pub fn new() -> Self

source§

impl<F, R> FindPathOptions<F, R>

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, R2>(self, cost_callback: F2) -> FindPathOptions<F2, R2>
where F2: FnMut(RoomName, CostMatrix) -> R2, R2: RoomCostResult,

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.

Trait Implementations§

source§

impl<R> Default for FindPathOptions<fn(_: RoomName, _: CostMatrix) -> R, R>

source§

fn default() -> Self

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

Auto Trait Implementations§

§

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> 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.