summaryrefslogtreecommitdiff
path: root/src/worldmessages.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-11 01:53:05 +0100
committertroido <troido@protonmail.com>2020-02-11 01:53:05 +0100
commit62138ca19acdef140359745ebee41be5e4c5ce09 (patch)
treea59c0d70d8b024693b2c57fc42ba3d1665623eb6 /src/worldmessages.rs
parent97850d8c1ee3522ccce30ef31ed91601da8c0730 (diff)
health is now also shown (but never changed)
Diffstat (limited to 'src/worldmessages.rs')
-rw-r--r--src/worldmessages.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/worldmessages.rs b/src/worldmessages.rs
index 48719f6..39eee6a 100644
--- a/src/worldmessages.rs
+++ b/src/worldmessages.rs
@@ -21,7 +21,8 @@ pub enum WorldUpdate {
Field(FieldMessage),
Pos(Pos),
Change(Vec<(Pos, Vec<String>)>),
- Inventory(Vec<String>)
+ Inventory(Vec<String>),
+ Health(i64, i64)
}
impl ToJson for WorldUpdate {
@@ -30,7 +31,8 @@ impl ToJson for WorldUpdate {
WorldUpdate::Field(msg) => json!(["field", msg]),
WorldUpdate::Pos(pos) => json!(["playerpos", pos]),
WorldUpdate::Change(changes) => json!(["changecells", changes]),
- WorldUpdate::Inventory(items) => json!(["inventory", items])
+ WorldUpdate::Inventory(items) => json!(["inventory", items]),
+ WorldUpdate::Health(health, maxhealth) => json!(["health", [health, maxhealth]])
}
}
}