Update GameSettings and add GameLinkEvent

This commit is contained in:
Martin Barksten
2016-09-13 12:45:24 +02:00
parent a21fff4912
commit f88009d206
3 changed files with 18 additions and 15 deletions

View File

@ -2,29 +2,22 @@
#[derive(Serialize, Deserialize, Debug)]
pub struct GameSettings {
pub width: String,
pub height: String,
pub maxNoofPlayers: u32,
pub startSnakeLength: u32,
pub timeInMsPerTick: u32,
pub obstaclesEnabled: bool,
pub foodEnabled: bool,
pub edgeWrapsAround: bool,
pub headToTailConsumes: bool,
pub tailConsumeGrows: bool,
pub addFoodLikelihood: u32,
pub removeFoodLikelihood: u32,
pub addObstacleLikelihood: u32,
pub removeObstacleLikelihood: u32,
pub spontaneousGrowthEveryNWorldTick: u32,
pub trainingGame: bool,
pub pointsPerLength: u32,
pub pointsPerFood: u32,
pub pointsPerCausedDeath: u32,
pub pointsPerNibble: u32,
pub pointsLastSnakeLiving: u32,
pub noofRoundsTailProtectedAfterNibble: u32,
pub pointsSuicide: i32,
}
#[derive(Serialize, Deserialize, Debug)]
@ -127,6 +120,15 @@ pub struct HeartBeatResponse {
pub receivingPlayerId: Option<String>
}
#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct GameLink {
#[serde(rename="type")]
pub type_: String,
pub receivingPlayerId: String,
pub gameId: String,
pub url: String,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct TournamentEnded {
#[serde(rename="type")]