summaryrefslogtreecommitdiff
path: root/src/json.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2019-06-26 16:42:43 +0200
committerJustin Worthe <justin@worthe-it.co.za>2019-06-26 16:42:43 +0200
commit40712a1c1b61c6e110f1bddd3e955bbfb797e5ab (patch)
tree12c698809ba240a5e62deddc9f1e2e7366fc9719 /src/json.rs
parent1aeab6da05a0c7b7dad4d06a38b282a82d5e1a51 (diff)
Implemented select move rules
Diffstat (limited to 'src/json.rs')
-rw-r--r--src/json.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/json.rs b/src/json.rs
index 09095b0..252481c 100644
--- a/src/json.rs
+++ b/src/json.rs
@@ -35,6 +35,7 @@ pub struct Player {
pub score: i32,
pub health: i32,
pub worms: Vec<PlayerWorm>,
+ pub remaining_worm_selections: u8,
}
impl Player {
@@ -60,6 +61,7 @@ pub struct Opponent {
pub id: i32,
pub score: i32,
pub worms: Vec<OpponentWorm>,
+ pub remaining_worm_selections: u8,
}
impl Opponent {
@@ -177,6 +179,8 @@ mod test {
"id": 1,
"score": 100,
"health": 300,
+ "currentWormId": 1,
+ "remainingWormSelections": 1,
"worms": [
{
"id": 1,
@@ -198,6 +202,7 @@ mod test {
{
"id": 2,
"score": 100,
+ "remainingWormSelections": 2,
"worms": [
{
"id": 1,
@@ -290,6 +295,7 @@ mod test {
id: 1,
score: 100,
health: 300,
+ remaining_worm_selections: 1,
worms: vec![PlayerWorm {
id: 1,
health: 100,
@@ -305,6 +311,7 @@ mod test {
opponents: vec![Opponent {
id: 2,
score: 100,
+ remaining_worm_selections: 2,
worms: vec![OpponentWorm {
id: 1,
health: 100,