diff --git a/src/input/dummy_player_controller.rs b/src/input/dummy_player_controller.rs index 31a6887..af0bc7d 100644 --- a/src/input/dummy_player_controller.rs +++ b/src/input/dummy_player_controller.rs @@ -44,6 +44,14 @@ impl PlayerController for DummyPlayerController { false } + fn map(&self) -> bool { + false + } + + fn inventory(&self) -> bool { + false + } + fn jump(&self) -> bool { false } @@ -80,6 +88,14 @@ impl PlayerController for DummyPlayerController { false } + fn trigger_map(&self) -> bool { + false + } + + fn trigger_inventory(&self) -> bool { + false + } + fn trigger_jump(&self) -> bool { false } diff --git a/src/input/keyboard_player_controller.rs b/src/input/keyboard_player_controller.rs index 32be7ca..56218a3 100644 --- a/src/input/keyboard_player_controller.rs +++ b/src/input/keyboard_player_controller.rs @@ -101,6 +101,14 @@ impl PlayerController for KeyboardController { self.state.next_weapon() } + fn map(&self) -> bool { + self.state.map() + } + + fn inventory(&self) -> bool { + self.state.inventory() + } + fn jump(&self) -> bool { self.state.jump() } @@ -137,6 +145,14 @@ impl PlayerController for KeyboardController { self.trigger.next_weapon() } + fn trigger_map(&self) -> bool { + self.trigger.map() + } + + fn trigger_inventory(&self) -> bool { + self.trigger.inventory() + } + fn trigger_jump(&self) -> bool { self.trigger.jump() } diff --git a/src/input/player_controller.rs b/src/input/player_controller.rs index 2e455d5..7aa63c2 100644 --- a/src/input/player_controller.rs +++ b/src/input/player_controller.rs @@ -26,6 +26,12 @@ pub trait PlayerController: PlayerControllerClone { /// True if "next weapon" button is down. fn next_weapon(&self) -> bool; + /// True if "map" button is down. + fn map(&self) -> bool; + + /// True if "inventory" button is down. + fn inventory(&self) -> bool; + /// True if "jump" button is down. fn jump(&self) -> bool; @@ -47,6 +53,10 @@ pub trait PlayerController: PlayerControllerClone { fn trigger_next_weapon(&self) -> bool; + fn trigger_map(&self) -> bool; + + fn trigger_inventory(&self) -> bool; + fn trigger_jump(&self) -> bool; fn trigger_shoot(&self) -> bool; diff --git a/src/input/touch_player_controller.rs b/src/input/touch_player_controller.rs index 48719bd..2af38bb 100644 --- a/src/input/touch_player_controller.rs +++ b/src/input/touch_player_controller.rs @@ -241,6 +241,14 @@ impl PlayerController for TouchPlayerController { self.state.next_weapon() } + fn map(&self) -> bool { + self.state.map() + } + + fn inventory(&self) -> bool { + self.state.inventory() + } + fn jump(&self) -> bool { self.state.jump() } @@ -278,6 +286,14 @@ impl PlayerController for TouchPlayerController { self.trigger.next_weapon() } + fn trigger_map(&self) -> bool { + self.trigger.map() + } + + fn trigger_inventory(&self) -> bool { + self.trigger.inventory() + } + fn trigger_jump(&self) -> bool { self.trigger.jump() }