DungeonCrawl
|
Exposes functions for working with potions. More...
Go to the source code of this file.
Data Structures | |
struct | potion_t |
struct | potion_table_t |
Enumerations | |
enum | potion_type_t { HEALING , MANA , STAMINA , MAX_POTION_TYPES } |
Functions | |
potion_t * | init_potion (potion_t *potion, const char *name, potion_type_t type, int value) |
creates a potion object with the given name, type and value | |
potion_table_t * | init_potion_table (memory_pool_t *memory_pool, const db_connection_t *db_connection) |
initializes a potion table with potions from the database | |
const char * | potion_type_to_string (potion_type_t type) |
Converts a potion type to a string representation. | |
void | free_potion (memory_pool_t *memory_pool, potion_t *potion) |
Frees the memory allocated for a potion. | |
void | free_potion_table (memory_pool_t *memory_pool, potion_table_t *table) |
Frees the memory allocated for a potion table. |
Exposes functions for working with potions.
Definition in file potion.h.
enum potion_type_t |
void free_potion | ( | memory_pool_t * | memory_pool, |
potion_t * | potion ) |
Frees the memory allocated for a potion.
memory_pool | Memory pool to free the potion |
potion | Potion object to be freed |
void free_potion_table | ( | memory_pool_t * | memory_pool, |
potion_table_t * | table ) |
Frees the memory allocated for a potion table.
memory_pool | Memory pool to free the potion table |
table | Potion table to be freed |
Definition at line 53 of file potion.c.
creates a potion object with the given name, type and value
potion | Potion object to be initialized |
name | Name of the potion |
type | Type defines the effect of the potion |
value | Value defining the strength of the effect |
Definition at line 11 of file potion.c.
potion_table_t * init_potion_table | ( | memory_pool_t * | memory_pool, |
const db_connection_t * | db_connection ) |
initializes a potion table with potions from the database
memory_pool | Memory pool to allocate the potion table |
db_connection | Database connection to fetch the potions from |
Definition at line 20 of file potion.c.
const char * potion_type_to_string | ( | potion_type_t | type | ) |
Converts a potion type to a string representation.
type | The potion type to convert |
Definition at line 40 of file potion.c.