[][src]Struct screeps::objects::FindOptions

pub struct FindOptions<'a, F> where
    F: Fn(RoomName, CostMatrix) -> Option<CostMatrix<'a>>, 
{ /* fields omitted */ }

Methods

impl FindOptions<'static, fn(_: RoomName, _: CostMatrix) -> Option<CostMatrix<'static>>>[src]

pub fn new() -> Self[src]

Creates default SearchOptions

impl<'a, F> FindOptions<'a, F> where
    F: Fn(RoomName, CostMatrix) -> Option<CostMatrix<'a>>, 
[src]

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

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

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

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

pub fn cost_callback<'b, F2>(self, cost_callback: F2) -> FindOptions<'b, F2> where
    F2: Fn(RoomName, CostMatrix) -> Option<CostMatrix<'b>>, 
[src]

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

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

Sets maximum ops - default 2000.

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

Sets heuristic weight - default 1.2.

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

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

pub fn max_rooms(self, rooms: u32) -> Self[src]

Sets maximum rooms - default 16, max 16.

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

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

Sets plain cost - default 1.

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

Sets swamp cost - default 5.

Trait Implementations

impl Default for FindOptions<'static, fn(_: RoomName, _: CostMatrix) -> Option<CostMatrix<'static>>>[src]

Auto Trait Implementations

impl<'a, F> Sync for FindOptions<'a, F> where
    F: Sync

impl<'a, F> Send for FindOptions<'a, F> where
    F: Send

impl<'a, F> Unpin for FindOptions<'a, F> where
    F: Unpin

impl<'a, F> RefUnwindSafe for FindOptions<'a, F> where
    F: RefUnwindSafe

impl<'a, F> UnwindSafe for FindOptions<'a, F> where
    F: UnwindSafe

Blanket Implementations

impl<T, U> IntoExpectedType<U> for T where
    U: FromExpectedType<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.