2021-01-27 18:20:47 +00:00
|
|
|
use crate::framework::context::Context;
|
|
|
|
use crate::framework::error::GameResult;
|
2022-11-19 17:20:03 +00:00
|
|
|
use crate::game::shared_game_state::SharedGameState;
|
2020-11-28 19:25:51 +00:00
|
|
|
use crate::input::player_controller::PlayerController;
|
|
|
|
|
|
|
|
/// A no-op implementation of player controller.
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct DummyPlayerController;
|
|
|
|
|
|
|
|
impl DummyPlayerController {
|
|
|
|
pub fn new() -> DummyPlayerController {
|
|
|
|
DummyPlayerController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl PlayerController for DummyPlayerController {
|
2020-12-20 20:57:17 +00:00
|
|
|
fn update(&mut self, _state: &mut SharedGameState, _ctx: &mut Context) -> GameResult {
|
2020-11-28 19:25:51 +00:00
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn update_trigger(&mut self) {}
|
|
|
|
|
|
|
|
fn move_up(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_left(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_down(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_right(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn prev_weapon(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn next_weapon(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2021-03-15 21:11:12 +00:00
|
|
|
fn map(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn inventory(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2020-11-28 19:25:51 +00:00
|
|
|
fn jump(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn shoot(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2021-01-02 02:39:50 +00:00
|
|
|
fn skip(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2022-02-26 01:51:10 +00:00
|
|
|
fn strafe(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2020-11-28 19:25:51 +00:00
|
|
|
fn trigger_up(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_left(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_down(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_right(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_prev_weapon(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_next_weapon(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2021-03-15 21:11:12 +00:00
|
|
|
fn trigger_map(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_inventory(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2020-11-28 19:25:51 +00:00
|
|
|
fn trigger_jump(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_shoot(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2021-01-02 02:39:50 +00:00
|
|
|
fn trigger_skip(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2022-02-26 01:51:10 +00:00
|
|
|
fn trigger_strafe(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2020-11-28 19:25:51 +00:00
|
|
|
fn trigger_menu_ok(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_menu_back(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trigger_menu_pause(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn look_up(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn look_left(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn look_down(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn look_right(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_analog_x(&self) -> f64 {
|
|
|
|
0.0
|
|
|
|
}
|
|
|
|
|
|
|
|
fn move_analog_y(&self) -> f64 {
|
|
|
|
0.0
|
|
|
|
}
|
2022-08-13 14:54:05 +00:00
|
|
|
|
|
|
|
fn set_rumble(&mut self, _low_freq: u16, _hi_freq: u16, _ticks: u32) {}
|
2020-11-28 19:25:51 +00:00
|
|
|
}
|