A bit of rethinking of game messages and command
authorunc0rr
Thu, 08 Nov 2018 21:57:05 +0100
changeset 14176 5ad911992460
parent 14175 76a52e8149e3
child 14177 a4dd3d307115
A bit of rethinking of game messages and command
rust/lib-hedgewars-engine/src/command.rs
rust/lib-hedgewars-engine/src/engine_message.rs
--- a/rust/lib-hedgewars-engine/src/command.rs	Thu Nov 08 22:22:47 2018 +0300
+++ b/rust/lib-hedgewars-engine/src/command.rs	Thu Nov 08 21:57:05 2018 +0100
@@ -1,4 +1,3 @@
 pub enum Command {
-    SetAmmo(String),
     ChatMessage(String),
 }
--- a/rust/lib-hedgewars-engine/src/engine_message.rs	Thu Nov 08 22:22:47 2018 +0300
+++ b/rust/lib-hedgewars-engine/src/engine_message.rs	Thu Nov 08 21:57:05 2018 +0100
@@ -11,6 +11,7 @@
     Up(KeystrokeAction),
     Down(KeystrokeAction),
     Precise(KeystrokeAction),
+    Attack(KeystrokeAction),
     NextTurn,
     Switch,
     Empty,
@@ -30,18 +31,88 @@
     Pong,
     Say(String),
     Taunt(u8),
-    ExecCommand(Command),
-    GameType(u8),// TODO: use enum
+    GameType(u8),
     Warning(String),
     StopSyncing,
-    ConfigRequest,
     GameOver,
     GameInterrupted,
+    GameSetupChecksum(String),
+}
+
+pub enum ConfigEngineMessage {
+    ConfigRequest,
+    SetAmmo(String),
+    SetScript(String),
+    SetScriptParam(String),
+    Spectate,
+    TeamLocality(bool),
+    SetMap(String),
+    SetTheme(String),
+    SetSeed(String),
+    SetTemplateFilter(String),
+    SetMapGenerator(String),
+    SetFeatureSize(u8),
+    SetDelay(u32),
+    SetReadyDelay(u32),
+    SetCratesFrequency(u8),
+    SetHealthCrateProbability(u8),
+    SetHealthCratesNumber(u8),
+    SetRoundsTilSuddenDeath(u8),
+    SetSuddenDeathWaterRiseSpeed(u8),
+    SetSuddenDeathHealthDecreaseRate(u8),
+    SetDamageMultiplier(u32),
+    SetRopeLength(u32),
+    SetGetawayTime(u32),
+    SetDudMinesPercent(u8),
+    SetMinesNumber(u32),
+    SetAirMinesNumber(u32),
+    SetBarrelsNumber(u32),
+    SetTurnTime(u32),
+    SetMinesTime(u32),
+    SetWorldEdge(u8),
+    Draw, // TODO
+    SetVoicePack(String),
+    AddHedgehog(String, u8, u32),
+    AddTeam(String, u8),
+    SetHedgehogCoordinates(i32, i32),
+    SetFort(String),
+    SetGrave(String),
+    SetHat(String),
+    SetFlag(String),
+    SetOwner(String),
+    SetOneClanMode(bool),
+    SetMultishootMode(bool),
+    SetSolidLand(bool),
+    SetBorders(bool),
+    SetDivideTeams(bool),
+    SetLowGravity(bool),
+    SetLaserSight(bool),
+    SetInvulnerability(bool),
+    SetHealthReset(bool),
+    SetVampiric(bool),
+    SetKarma(bool),
+    SetArtilleryMode(bool),
+    SetHedgehogSwitch(bool),
+    SetRandomOrder(bool),
+    SetKingMode(bool),
+    SetPlaceHedgehog(bool),
+    SetSharedAmmo(bool),
+    SetGirdersEnabled(bool),
+    SetLandObjectsEnabled(bool),
+    SetAISurvivalMode(bool),
+    SetInfiniteAttack(bool),
+    SetResetWeapons(bool),
+    SetAmmoPerHedgehog(bool),
+    SetWindMode(u8),
+    SetTagTeam(bool),
+    SetBottomBorder(bool),
+    SetShoppaBorder(bool),
 }
 
 pub enum EngineMessage {
     Synced(SyncedEngineMessage, u32),
     Unsynced(UnsyncedEngineMessage),
+    Config(ConfigEngineMessage),
 }
 
 impl EngineMessage {