pub struct AiAbility {Show 15 fields
pub id: u32,
pub name: String,
pub cooldown: f32,
pub cooldown_remaining: f32,
pub cast_time: f32,
pub range: f32,
pub area_radius: f32,
pub damage: f32,
pub healing: f32,
pub energy_cost: f32,
pub is_casting: bool,
pub cast_elapsed: f32,
pub target_pos: Vec3,
pub target_entity: Option<u64>,
pub tags: HashSet<String>,
}Fields§
§id: u32§name: String§cooldown: f32§cooldown_remaining: f32§cast_time: f32§range: f32§area_radius: f32§damage: f32§healing: f32§energy_cost: f32§is_casting: bool§cast_elapsed: f32§target_pos: Vec3§target_entity: Option<u64>Implementations§
Source§impl AiAbility
impl AiAbility
pub fn new(id: u32, name: &str, cooldown: f32, range: f32) -> Self
pub fn is_ready(&self) -> bool
pub fn can_reach(&self, user_pos: Vec3, target_pos: Vec3) -> bool
pub fn start_cast(&mut self, target_pos: Vec3, target_entity: Option<u64>)
pub fn tick(&mut self, dt: f32) -> bool
pub fn interrupt(&mut self)
pub fn cast_progress(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AiAbility
impl RefUnwindSafe for AiAbility
impl Send for AiAbility
impl Sync for AiAbility
impl Unpin for AiAbility
impl UnsafeUnpin for AiAbility
impl UnwindSafe for AiAbility
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.