Skip to main content

pfx_play/
events.rs

1use crate::world::{Contact, ObjectId};
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
4pub enum Phase {
5    Enter,
6    Stay,
7    Exit,
8}
9
10#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
11pub struct TriggerEvent {
12    pub phase: Phase,
13    pub trigger: ObjectId,
14    pub other: ObjectId,
15}
16
17#[derive(Clone, Copy, Debug, PartialEq)]
18pub enum WorldEvent {
19    Contact(Contact),
20    Trigger(TriggerEvent),
21}