pub struct ActionTrackerSpawnRequested {
pub entity: AiEntity,
pub action: ScoredAction,
pub tracker_config: Option<ActionTrackerSpawnConfig>,
}Expand description
An Event representing some system asking the library to track an Action. You could DIY it, but using this Event should cover typical usecases for ya.
Fields§
§entity: AiEntityNOTE: The entity here is intended to be the AIController. EntityEvent API sadly doesn’t let us rename that for clarity.
action: ScoredAction§tracker_config: Option<ActionTrackerSpawnConfig>Implementations§
Source§impl ActionTrackerSpawnRequested
impl ActionTrackerSpawnRequested
Sourcepub fn new(
entity: Entity,
action: ScoredAction,
config: Option<ActionTrackerSpawnConfig>,
) -> Self
pub fn new( entity: Entity, action: ScoredAction, config: Option<ActionTrackerSpawnConfig>, ) -> Self
Create a new ActionTracker spawn request.
Sourcepub fn with_library_defaults(entity: Entity, action: ScoredAction) -> Self
pub fn with_library_defaults(entity: Entity, action: ScoredAction) -> Self
Create a new ActionTracker spawn request, with whatever defaults the library picked for you.
Sourcepub fn with_config(
entity: Entity,
action: ScoredAction,
config: ActionTrackerSpawnConfig,
) -> Self
pub fn with_config( entity: Entity, action: ScoredAction, config: ActionTrackerSpawnConfig, ) -> Self
Create a new ActionTracker spawn request with a specified config.
Sourcepub fn with_config_builder(
entity: Entity,
action: ScoredAction,
builder: &mut dyn FnMut(ActionTrackerSpawnConfigBuilder) -> Option<ActionTrackerSpawnConfig>,
) -> Self
pub fn with_config_builder( entity: Entity, action: ScoredAction, builder: &mut dyn FnMut(ActionTrackerSpawnConfigBuilder) -> Option<ActionTrackerSpawnConfig>, ) -> Self
Create a new ActionTracker spawn request, allowing the config to be built by evaluating a specified callback on the ActionTrackerSpawnConfigBuilder.
Kind of like the Option::or_else() API and the like, lazy evaluation.
Mainly a syntax sugar API so you don’t have to create a Builder yourself.
Trait Implementations§
Source§impl EntityEvent for ActionTrackerSpawnRequested
impl EntityEvent for ActionTrackerSpawnRequested
Source§fn event_target(&self) -> Entity
fn event_target(&self) -> Entity
Entity “target” of this EntityEvent. When triggered, this will run observers that watch for this specific entity.Auto Trait Implementations§
impl Freeze for ActionTrackerSpawnRequested
impl RefUnwindSafe for ActionTrackerSpawnRequested
impl Send for ActionTrackerSpawnRequested
impl Sync for ActionTrackerSpawnRequested
impl Unpin for ActionTrackerSpawnRequested
impl UnsafeUnpin for ActionTrackerSpawnRequested
impl UnwindSafe for ActionTrackerSpawnRequested
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more