use bevy::ecs::entity::Entity;
use bevy::ecs::event::EntityEvent;
#[derive(EntityEvent)]
pub struct ActionEvent<ActionKey> {
#[event_target]
pub(crate) controller: Entity,
pub(crate) controlling: Vec<Entity>,
pub(crate) action_key: ActionKey,
}
impl<ActionKey> ActionEvent<ActionKey> {
pub fn controller(&self) -> Entity {
self.controller
}
pub fn key<'a>(&'a self) -> &'a ActionKey {
&self.action_key
}
pub fn controlling<'a>(&'a self) -> &'a Vec<Entity> {
&self.controlling
}
}