aboutsummaryrefslogtreecommitdiff
path: root/src/events.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/events.rs')
-rw-r--r--src/events.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/events.rs b/src/events.rs
new file mode 100644
index 0000000..43ca1ba
--- /dev/null
+++ b/src/events.rs
@@ -0,0 +1,19 @@
+//! Events which enable interactions between `Interactor` and `Interactable` entities.
+
+use bevy::prelude::*;
+
+/// Event sent by user to request an interaction from the given `Interactor` entity.
+#[derive(Event)]
+pub struct InteractorFiredEvent(pub Entity);
+
+/// Event sent by the plugin once an `InteractorFiredEvent` has been processed. It should be caught
+/// by the user to perform some action on the affected interactable entity.
+///
+/// It is not intended to be invoked directly.
+#[derive(Event)]
+pub struct InteractionEvent {
+ /// `Interactor` entity which triggered this interaction.
+ pub interactor: Entity,
+ /// `Interactable` entity whicg is receiving this interaction.
+ pub interactable: Entity,
+}