summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2020-04-13 11:33:08 +0200
committerJustin Wernick <justin@worthe-it.co.za>2020-04-13 11:33:08 +0200
commit80485b855c5628adc2fa619de21164ded1a0cae1 (patch)
treea95289a154b8d206ae2f2dcc9fdb3fb7213757f7
parent790c3c73f909e1e39249303437e34223eef27f1c (diff)
Commented out parts of the state that are unused
-rw-r--r--src/json.rs45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/json.rs b/src/json.rs
index 79f20e9..1726f9f 100644
--- a/src/json.rs
+++ b/src/json.rs
@@ -19,8 +19,8 @@ pub fn read_state_from_json_file(filename: &str) -> Result<GameState> {
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct JsonState {
- pub current_round: usize,
- pub max_rounds: usize,
+ // pub current_round: usize,
+ // pub max_rounds: usize,
pub player: JsonPlayer,
pub opponent: JsonOpponent,
pub world_map: Vec<Vec<JsonWorldMapCell>>,
@@ -29,19 +29,19 @@ pub struct JsonState {
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct JsonPlayer {
- id: usize,
+ // id: usize,
position: JsonPosition,
speed: usize,
- state: JsonPlayerState,
+ // state: JsonPlayerState,
powerups: Vec<JsonPowerup>,
- boosting: bool,
+ // boosting: bool,
boost_counter: usize,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct JsonOpponent {
- id: usize,
+ // id: usize,
position: JsonPosition,
speed: usize,
}
@@ -51,7 +51,7 @@ pub struct JsonOpponent {
pub struct JsonWorldMapCell {
position: JsonPosition,
surface_object: JsonSurfaceObject,
- occupied_by_player_id: usize,
+ // occupied_by_player_id: usize,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
@@ -61,21 +61,22 @@ pub struct JsonPosition {
y: usize,
}
-#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
-#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
-pub enum JsonPlayerState {
- Ready,
- Nothing,
- TurningLeft,
- TurningRight,
- Accelerating,
- Decelarating,
- PickedUpPowerup,
- UsedBoost,
- UsedOil,
- HitMud,
- Finishing,
-}
+// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
+// #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
+// pub enum JsonPlayerState {
+// Ready,
+// Nothing,
+// TurningLeft,
+// TurningRight,
+// Accelerating,
+// Decelarating,
+// PickedUpPowerup,
+// UsedBoost,
+// UsedOil,
+// HitMud,
+// HitOil,
+// Finishing,
+// }
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]