MCPcopy Create free account
hub / github.com/PerroEngine/Perro / from_actions

Method from_actions

perro_source/api_modules/perro_input_api/src/input_map.rs:31–45  ·  view source on GitHub ↗
(mut actions: Vec<InputAction>)

Source from the content-addressed store, hash-verified

29 }
30
31 pub fn from_actions(mut actions: Vec<InputAction>) -> Self {
32 for action in &mut actions {
33 action.name_hash = action_hash(&action.name);
34 }
35 let mut input_map = Self {
36 actions,
37 action_slots: Vec::new(),
38 key_actions: vec![Vec::new(); KeyCode::COUNT],
39 mouse_actions: vec![Vec::new(); MouseButton::COUNT],
40 gamepad_actions: vec![Vec::new(); GamepadButton::COUNT],
41 joycon_actions: vec![Vec::new(); JoyConButton::COUNT],
42 };
43 input_map.rebuild_indexes();
44 input_map
45 }
46
47 #[inline]
48 pub fn actions(&self) -> &[InputAction] {

Callers

nothing calls this directly

Calls 2

action_hashFunction · 0.85
rebuild_indexesMethod · 0.80

Tested by

no test coverage detected