From 21919636f95a1214b7ed1a3e4aa6527f45b9d073 Mon Sep 17 00:00:00 2001 From: troido Date: Wed, 4 Mar 2020 12:15:58 +0100 Subject: interacting now works --- src/controls.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/controls.rs') 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), - AttackTarget(Entity) + AttackTarget(Entity), + Interact(Vec) } @@ -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} -- cgit