equal
deleted
inserted
replaced
|
1 use crate::command::Command; |
|
2 |
|
3 pub enum KeystrokeAction { |
|
4 Press, |
|
5 Release, |
|
6 } |
|
7 |
|
8 pub enum SyncedEngineMessage { |
|
9 Left(KeystrokeAction), |
|
10 Right(KeystrokeAction), |
|
11 Up(KeystrokeAction), |
|
12 Down(KeystrokeAction), |
|
13 Precise(KeystrokeAction), |
|
14 NextTurn, |
|
15 Switch, |
|
16 Empty, |
|
17 Timer(u8), |
|
18 Slot(u8), |
|
19 SetWeapon(u8), |
|
20 Put(i32, i32), |
|
21 HighJump, |
|
22 LowJump, |
|
23 Skip, |
|
24 TeamControlGained(String), |
|
25 TeamControlLost(String), |
|
26 } |
|
27 |
|
28 pub enum UnsyncedEngineMessage { |
|
29 Ping, |
|
30 Pong, |
|
31 Say(String), |
|
32 Taunt(u8), |
|
33 ExecCommand(Command), |
|
34 GameType(u8),// TODO: use enum |
|
35 Warning(String), |
|
36 StopSyncing, |
|
37 ConfigRequest, |
|
38 GameOver, |
|
39 GameInterrupted, |
|
40 } |
|
41 |
|
42 pub enum EngineMessage { |
|
43 Synced(SyncedEngineMessage, u32), |
|
44 Unsynced(UnsyncedEngineMessage), |
|
45 } |
|
46 |
|
47 impl EngineMessage { |
|
48 fn from_bytes(buf: &[u8]) -> Self { |
|
49 unimplemented!() |
|
50 } |
|
51 |
|
52 fn to_bytes(&self) -> Vec<u8> { |
|
53 unimplemented!() |
|
54 } |
|
55 } |