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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use amethyst::ecs::Entity;
use std::collections::VecDeque;
#[derive(Default)]
pub struct MapChangeAnnouncementQueue {
queue: VecDeque<MapChangeAnnouncement>,
}
impl MapChangeAnnouncementQueue {
pub fn push(&mut self, announcement: MapChangeAnnouncement) {
self.queue.push_back(announcement);
}
pub fn pop_front(&mut self) {
self.queue.pop_front();
}
pub fn front_mut(&mut self) -> Option<&mut MapChangeAnnouncement> {
self.queue.front_mut()
}
pub fn is_empty(&self) -> bool {
self.queue.is_empty()
}
pub fn len(&self) -> usize {
self.queue.len()
}
}
pub struct MapChangeAnnouncement {
pub elapsed_time: f32,
pub state: MapChangeAnnouncementState,
pub box_entity: Entity,
pub text_entity: Entity,
}
pub enum MapChangeAnnouncementState {
Opening,
Waiting,
Closing,
}