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
use serde_derive::{Deserialize, Serialize};
pub mod added_unit_event;
pub mod chat_multicast_event;
pub mod chat_teamcast_event;
pub mod chat_unicast_event;
pub mod controllable_unregistered;
pub mod death_controllable_event;
pub mod depleted_resource_event;
pub mod full_update_player_event;
pub mod message_system_event;
pub mod partial_update_player_event;
pub mod removed_player_event;
pub mod removed_unit_event;
pub mod tick_processed_event;
pub mod universe_group_info_event;
pub mod updated_controllable_event;
pub mod updated_unit_event;
pub trait ApplicableEvent<T> {
fn apply(self, target: &mut T)
where
Self: Sized;
}
pub trait Completable<T> {
fn complete(&mut self, source: &T);
}
impl<T, C: Completable<T>> Completable<T> for Option<C> {
fn complete(&mut self, source: &T) {
if let Some(this) = self {
this.complete(source);
}
}
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct FailureEvent {
pub message: String,
}