3 * The Command DB collects all commands the user can give. It only contains
4 * identifiers and descriptions of commands, not the functions executing these
5 * commands. Coupling with those happens elsewhere.
13 #include <stdint.h> /* for uint8_t */
20 uint8_t id; /* unique identifier of command */
21 char * dsc_short; /* short string name of command to be used internally */
22 char * dsc_long; /* long string description of command for the user */
27 uint8_t n; /* number of Command structs in database*/
28 struct Command * cmds; /* pointer to first Command struct in database */
33 /* Is "id" the ID of command whose dsc_short is "shortdsc"? Answer in binary. */
34 extern uint8_t is_command_id_shortdsc(struct World * world,
35 uint8_t id, char * shortdsc);
37 /* Give short description of command ("dsc_short"), get its ID. */
38 extern uint8_t get_command_id(struct World * world, char * dsc_short);
40 /* Give short description of command ("dsc_short"), get long description. */
41 extern char * get_command_longdsc(struct World * world, char * dsc_short);
45 /* Read in CommandDB from file "config/commands" to world.cmd_db. */
46 extern void init_command_db(struct World * world);
48 /* Free all memory allocated with init_command_db. */
49 extern void free_command_db(struct World * world);