aboutsummaryrefslogtreecommitdiff
path: root/src/events.rs
blob: 2fa7f8152aaa07a0398e922cf6624e78eb393f15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use std::path::PathBuf;

use bevy::prelude::*;

/// Events related to activities in the dirworld.
#[derive(Event)]
pub enum DirworldNavigationEvent {
    /// Triggered when a room is left.
    LeftRoom {
        /// Path of room just left.
        path: PathBuf,
    },
    /// Triggered when a room is entered.
    EnteredRoom {
        /// Path of room just entered.
        path: PathBuf,
    },
}

#[derive(Debug, Event, Deref, DerefMut, Clone)]
pub struct DirworldLeaveRoom(pub PathBuf);

#[derive(Debug, Event, Deref, DerefMut, Clone)]
pub struct DirworldEnterRoom(pub PathBuf);

#[derive(Debug, Event, Deref, DerefMut, Clone)]
pub struct DirworldChangeRoot(pub PathBuf);

#[derive(Event)]
pub struct DirworldSpawn {
    pub entity: Entity,
    pub data: Option<Vec<u8>>,
}