home · contact · privacy
Strongly simplified / standardized user action interfaces.
[plomrogue] / src / control.h
index 79e5976e7b5010019df474c994ac4fa25dea2e91..30b2dda06b6d49d624903879535d975d3ad64efb 100644 (file)
@@ -6,25 +6,36 @@
 #ifndef CONTROL_H
 #define CONTROL_H
 
+#include <stdint.h> /* for uint8_t */
 
 
-#include <stdint.h> /* for uint8_t */
-struct World;
+
+/* Return keycode to action of "name" if available in current window config. */
+extern uint16_t get_available_keycode_to_action(char * name);
+
+
+
+/* Control the player character, either via action id "action" or pressed "key".
+ * Return 1 on success, 0 if no appropriate action to trigger was found.
+ */
+extern uint8_t player_control_by_key(int key);
+extern uint8_t player_control_by_id(int action);
 
 
 
-/* Control the player character, either via recorded "action" or pressed "key".
+/* Control via "key" active window's geometry / keybindings in respective config
+ * view.
  */
-extern void record_control(int action, struct World * world);
-extern uint8_t player_control(int key, struct World * world);
+extern uint8_t wingeom_control(int key);
+extern uint8_t winkeyb_control(int key);
 
 
 
-/* Call by "key" game / window management actions that don't influence the
- * player character. If the "quit" action is called, return 1 (instead of
+/* Call by "key" further game / window management actions that don't influence
+ * the player character. If the "quit" action is called, return 1 (instead of
  * exiting directly).
  */
-extern uint8_t meta_control(int key, struct World * world);
+extern uint8_t meta_control(int key);