summaryrefslogtreecommitdiff
path: root/src/controls.rs
diff options
context:
space:
mode:
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}