summaryrefslogtreecommitdiff
path: root/src/controls.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-03-04 12:15:58 +0100
committertroido <troido@protonmail.com>2020-03-04 12:15:58 +0100
commit21919636f95a1214b7ed1a3e4aa6527f45b9d073 (patch)
treedfe7a465cdf81048c3ac04b5719571bb0192791f /src/controls.rs
parentdaae8b511291b8cc854a8747e64e76c6ff2d462e (diff)
interacting now works
Diffstat (limited to 'src/controls.rs')
-rw-r--r--src/controls.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/controls.rs b/src/controls.rs
index d3dec68..581b522 100644
--- a/src/controls.rs
+++ b/src/controls.rs
@@ -47,7 +47,8 @@ pub enum Control {
Drop(usize),
Use(usize),
Attack(Vec<Direction>),
- AttackTarget(Entity)
+ AttackTarget(Entity),
+ Interact(Vec<Direction>)
}
@@ -69,6 +70,13 @@ impl Control {
}
directions
})),
+ "interact" => Some(Control::Interact({
+ let mut directions = Vec::new();
+ for dir in val.get(1)?.as_array()? {
+ directions.push(Direction::from_json(dir)?);
+ }
+ directions
+ })),
_ => None
}
} else {None}