pub fn press(&mut self, input: &mut Read<InputHandler<String, String>>, name: &str) -> bool {
        if input.action_is_down(name).unwrap() {
            if *self.key_presses.get(name).unwrap() == 0 {
                *self.key_presses.get_mut(name).unwrap() = 1;
                return true;
            }
        }
        else {
            *self.key_presses.get_mut(name).unwrap() = 0;
        }

        return false;
    }
// looks wether an action is only pressed once, good for controller support later
looks wether an action is only pressed once, good for controller support later
looks wether an action is only pressed once good for controller support later
pub fn press(&mut self, input: &mut Read<InputHandler<String, String>>, name: &str) -> bool {
        if input.action_is_down(name).unwrap() {
            if *self.key_presses.get(name).unwrap() == 0 {
                *self.key_presses.get_mut(name).unwrap() = 1;
                return true;
            }
        }
        else {
            *self.key_presses.get_mut(name).unwrap() = 0;
        }
        return false;
    }
pub fn press ( & mut self , input : & mut Read < InputHandler < String , String > > , name : & str ) -> bool { if input . action_is_down ( name ) . unwrap ( ) { if * self . key_presses . get ( name ) . unwrap ( ) == 0 { * self . key_presses . get_mut ( name ) . unwrap ( ) = 1 ; return true ; } } else { * self . key_presses . get_mut ( name ) . unwrap ( ) = 0 ; } return false ; }
looks wether an action is only pressed once, good for controller support later
looks wether an action is only pressed once good for controller support later
&mut self
input
&mut Read<InputHandler<String, String>>
name
&str
&mut self
input
&mut Read<InputHandler<String, String>>
name
&str