14230
|
1 |
#[derive(Debug, PartialEq)]
|
|
2 |
pub enum KeystrokeAction {
|
|
3 |
Press,
|
|
4 |
Release,
|
|
5 |
}
|
|
6 |
|
|
7 |
#[derive(Debug, PartialEq)]
|
|
8 |
pub enum SyncedEngineMessage {
|
|
9 |
Left(KeystrokeAction),
|
|
10 |
Right(KeystrokeAction),
|
|
11 |
Up(KeystrokeAction),
|
|
12 |
Down(KeystrokeAction),
|
|
13 |
Precise(KeystrokeAction),
|
|
14 |
Attack(KeystrokeAction),
|
|
15 |
NextTurn,
|
|
16 |
Switch,
|
|
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),
|
14231
|
26 |
TimeWrap,
|
14230
|
27 |
}
|
|
28 |
|
|
29 |
#[derive(Debug, PartialEq)]
|
|
30 |
pub enum UnsyncedEngineMessage {
|
|
31 |
Ping,
|
|
32 |
Pong,
|
|
33 |
Say(String),
|
|
34 |
Taunt(u8),
|
|
35 |
GameType(u8),
|
|
36 |
Warning(String),
|
|
37 |
StopSyncing,
|
|
38 |
GameOver,
|
|
39 |
GameInterrupted,
|
|
40 |
GameSetupChecksum(String),
|
|
41 |
}
|
|
42 |
|
|
43 |
#[derive(Debug, PartialEq)]
|
|
44 |
pub enum ConfigEngineMessage {
|
|
45 |
ConfigRequest,
|
|
46 |
SetAmmo(String),
|
|
47 |
SetScript(String),
|
|
48 |
SetScriptParam(String),
|
|
49 |
Spectate,
|
|
50 |
TeamLocality(bool),
|
|
51 |
SetMap(String),
|
|
52 |
SetTheme(String),
|
|
53 |
SetSeed(String),
|
|
54 |
SetTemplateFilter(String),
|
|
55 |
SetMapGenerator(String),
|
|
56 |
SetFeatureSize(u8),
|
|
57 |
SetDelay(u32),
|
|
58 |
SetReadyDelay(u32),
|
|
59 |
SetCratesFrequency(u8),
|
|
60 |
SetHealthCrateProbability(u8),
|
|
61 |
SetHealthCratesNumber(u8),
|
|
62 |
SetRoundsTilSuddenDeath(u8),
|
|
63 |
SetSuddenDeathWaterRiseSpeed(u8),
|
|
64 |
SetSuddenDeathHealthDecreaseRate(u8),
|
|
65 |
SetDamageMultiplier(u32),
|
|
66 |
SetRopeLength(u32),
|
|
67 |
SetGetawayTime(u32),
|
|
68 |
SetDudMinesPercent(u8),
|
|
69 |
SetMinesNumber(u32),
|
|
70 |
SetAirMinesNumber(u32),
|
|
71 |
SetBarrelsNumber(u32),
|
|
72 |
SetTurnTime(u32),
|
|
73 |
SetMinesTime(u32),
|
|
74 |
SetWorldEdge(u8),
|
|
75 |
Draw,
|
|
76 |
// TODO
|
|
77 |
SetVoicePack(String),
|
|
78 |
AddHedgehog(String, u8, u32),
|
|
79 |
AddTeam(String, u8),
|
|
80 |
SetHedgehogCoordinates(i32, i32),
|
|
81 |
SetFort(String),
|
|
82 |
SetGrave(String),
|
|
83 |
SetHat(String),
|
|
84 |
SetFlag(String),
|
|
85 |
SetOwner(String),
|
|
86 |
SetOneClanMode(bool),
|
|
87 |
SetMultishootMode(bool),
|
|
88 |
SetSolidLand(bool),
|
|
89 |
SetBorders(bool),
|
|
90 |
SetDivideTeams(bool),
|
|
91 |
SetLowGravity(bool),
|
|
92 |
SetLaserSight(bool),
|
|
93 |
SetInvulnerability(bool),
|
|
94 |
SetHealthReset(bool),
|
|
95 |
SetVampiric(bool),
|
|
96 |
SetKarma(bool),
|
|
97 |
SetArtilleryMode(bool),
|
|
98 |
SetHedgehogSwitch(bool),
|
|
99 |
SetRandomOrder(bool),
|
|
100 |
SetKingMode(bool),
|
|
101 |
SetPlaceHedgehog(bool),
|
|
102 |
SetSharedAmmo(bool),
|
|
103 |
SetGirdersEnabled(bool),
|
|
104 |
SetLandObjectsEnabled(bool),
|
|
105 |
SetAISurvivalMode(bool),
|
|
106 |
SetInfiniteAttack(bool),
|
|
107 |
SetResetWeapons(bool),
|
|
108 |
SetAmmoPerHedgehog(bool),
|
|
109 |
SetWindMode(u8),
|
|
110 |
SetTagTeam(bool),
|
|
111 |
SetBottomBorder(bool),
|
|
112 |
SetShoppaBorder(bool),
|
|
113 |
}
|
|
114 |
|
|
115 |
#[derive(Debug, PartialEq)]
|
|
116 |
pub enum EngineMessage {
|
|
117 |
Synced(SyncedEngineMessage, u32),
|
|
118 |
Unsynced(UnsyncedEngineMessage),
|
|
119 |
Config(ConfigEngineMessage),
|
|
120 |
Unknown,
|
|
121 |
Empty,
|
|
122 |
}
|
|
123 |
|
|
124 |
impl EngineMessage {
|
|
125 |
fn from_bytes(buf: &[u8]) -> Self {
|
|
126 |
unimplemented!()
|
|
127 |
}
|
|
128 |
|
|
129 |
fn to_bytes(&self) -> Vec<u8> {
|
|
130 |
unimplemented!()
|
|
131 |
}
|
|
132 |
}
|