home · contact · privacy
Some refactoring in map_object_actions library.
[plomrogue] / src / command_db.h
index efa342a2433e302225ac6d732fe2c80a03bc9caa..866f5e34a577eaba89ccd38b2381f83835a6598b 100644 (file)
@@ -8,10 +8,7 @@
 #ifndef COMMAND_DB_H
 #define COMMAND_DB_H
 
-
-
 #include <stdint.h> /* for uint8_t */
-struct World;
 
 
 
@@ -19,7 +16,7 @@ struct Command
 {
     uint8_t id;       /* unique identifier of command */
     char * dsc_short; /* short string name of command to be used internally */
-    char * dsc_long;  /* long string description of command for the  user */
+    char * dsc_long;  /* long string description of command for the user */
 };
 
 struct CommandDB
@@ -30,18 +27,20 @@ struct CommandDB
 
 
 
-/* Give short description of command ("dsc_short"), get long descrption. */
-extern char * get_command_longdsc(struct World * world, char * dsc_short);
+/* Is "id" the ID of command whose dsc_short is "shortdsc"? Answer in binary. */
+extern uint8_t is_command_id_shortdsc(uint8_t id, char * shortdsc);
 
+/* Give short description of command ("dsc_short"), get its ID. */
+extern uint8_t get_command_id(char * dsc_short);
 
+/* Give short description of command ("dsc_short"), get long description. */
+extern char * get_command_longdsc(char * dsc_short);
 
 /* Read in CommandDB from file "config/commands" to world.cmd_db. */
-extern void init_command_db(struct World * world);
-
-
+extern void init_command_db();
 
 /* Free all memory allocated with init_command_db. */
-extern void free_command_db(struct World * world);
+extern void free_command_db();