pub struct GotoEvent {
pub entity: Entity,
pub goal: Arc<dyn Goal>,
pub successors_fn: SuccessorsFn,
pub allow_mining: bool,
pub min_timeout: PathfinderTimeout,
pub max_timeout: PathfinderTimeout,
}
Expand description
Send this event to start pathfinding to the given goal.
Also see PathfinderClientExt::goto
.
This event is read by goto_listener
.
Fields§
§entity: Entity
The local bot entity that will do the pathfinding and execute the path.
goal: Arc<dyn Goal>
§successors_fn: SuccessorsFn
The function that’s used for checking what moves are possible. Usually
pathfinder::moves::default_move
allow_mining: bool
Whether the bot is allowed to break blocks while pathfinding.
min_timeout: PathfinderTimeout
The minimum amount of time that should pass before the A* pathfinder
function can return a timeout. It may take up to Self::max_timeout
if it can’t immediately find a usable path.
A good default value for this is
PathfinderTimeout::Time(Duration::from_secs(1))
.
Also see PathfinderTimeout::Nodes
max_timeout: PathfinderTimeout
The absolute maximum amount of time that the pathfinder function can take to find a path. If it takes this long, it means no usable path was found (so it might be impossible).
A good default value for this is
PathfinderTimeout::Time(Duration::from_secs(5))
.
Trait Implementations§
Source§impl Event for GotoEvent
impl Event for GotoEvent
Source§const AUTO_PROPAGATE: bool = false
const AUTO_PROPAGATE: bool = false
Trigger::propagate
.Source§type Traversal = ()
type Traversal = ()
§fn register_component_id(world: &mut World) -> ComponentId
fn register_component_id(world: &mut World) -> ComponentId
ComponentId
] for this event type. Read more§fn component_id(world: &World) -> Option<ComponentId>
fn component_id(world: &World) -> Option<ComponentId>
ComponentId
] for this event type,
if it has already been generated. Read moreAuto Trait Implementations§
impl Freeze for GotoEvent
impl !RefUnwindSafe for GotoEvent
impl Send for GotoEvent
impl Sync for GotoEvent
impl Unpin for GotoEvent
impl !UnwindSafe for GotoEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.