pub struct GuardianAbility {
pub(crate) first_action_delay_ms: u32,
pub(crate) action_interval_ms: u32,
pub(crate) hasted_first_action: bool,
pub(crate) hasted_action_interval: bool,
pub(crate) max_actions: u16,
pub(crate) ends_guardian: bool,
pub(crate) self_scheduled: bool,
pub(crate) action: GuardianActionFn,
}Expand description
One independently scheduled ability owned by a temporary guardian.
Fields§
§first_action_delay_ms: u32§action_interval_ms: u32§hasted_first_action: bool§hasted_action_interval: bool§max_actions: u16§ends_guardian: bool§self_scheduled: bool§action: GuardianActionFnImplementations§
Source§impl GuardianAbility
impl GuardianAbility
pub const fn new(action_interval_ms: u32, action: GuardianActionFn) -> Self
Sourcepub const fn on_demand(action: GuardianActionFn) -> Self
pub const fn on_demand(action: GuardianActionFn) -> Self
An owner-driven ability that never self-schedules.
Dispatch it with crate::GuardianOps::command_guardians.
pub const fn first_action_delay(self, delay_ms: u32) -> Self
pub const fn hasted_actions(self) -> Self
Sourcepub const fn hasted_action_interval(self) -> Self
pub const fn hasted_action_interval(self) -> Self
Scale repeating action intervals with live haste while preserving a fixed initial delay.
Sourcepub const fn max_actions(self, count: u16) -> Self
pub const fn max_actions(self, count: u16) -> Self
Stop this ability after exactly count actions; zero means lifetime-only.
Sourcepub const fn ends_guardian(self) -> Self
pub const fn ends_guardian(self) -> Self
Despawn the owning guardian when this bounded ability completes.
Trait Implementations§
Source§impl Clone for GuardianAbility
impl Clone for GuardianAbility
Source§fn clone(&self) -> GuardianAbility
fn clone(&self) -> GuardianAbility
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GuardianAbility
impl Debug for GuardianAbility
impl Copy for GuardianAbility
Auto Trait Implementations§
impl Freeze for GuardianAbility
impl RefUnwindSafe for GuardianAbility
impl Send for GuardianAbility
impl Sync for GuardianAbility
impl Unpin for GuardianAbility
impl UnsafeUnpin for GuardianAbility
impl UnwindSafe for GuardianAbility
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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