DungeonCrawl
|
Declares functions to load and free potion and gear tables from the game database, and count entries. More...
#include "../../combat/ability.h"
#include "../../item/gear.h"
#include "../../item/potion.h"
#include "../database.h"
Go to the source code of this file.
Data Structures | |
struct | potion_init_t |
To get potion table from the database, we need to define a struct This struct is for the initialization of the potion table The values of the struct corresponds to the init_potion() method in. More... | |
struct | gear_init_t |
To get gear table from the database, we need to define a struct This struct is for the initialization of the gear table The value of the struct corresponds to the init_gear() method in. More... |
Typedefs | |
typedef struct potion_init_t | potion_init_t |
To get potion table from the database, we need to define a struct This struct is for the initialization of the potion table The values of the struct corresponds to the init_potion() method in. | |
typedef struct gear_init_t | gear_init_t |
To get gear table from the database, we need to define a struct This struct is for the initialization of the gear table The value of the struct corresponds to the init_gear() method in. |
Functions | |
potion_init_t * | init_potion_table_from_db (const db_connection_t *db_connection) |
Get the potion table from the database. | |
void | free_potion_table_from_db (potion_init_t *potion_init_table, const db_connection_t *db_connection) |
Clean up the potion table Call this function to free the memory allocated for the potion table. | |
int | count_potions_in_db (const db_connection_t *db_connection) |
Count the number of potions in the database. | |
gear_init_t * | init_gear_table_from_db (const db_connection_t *db_connection) |
Get the gear table from the database. | |
void | free_gear_table_from_db (gear_init_t *gear_init_table, const db_connection_t *db_connection) |
Clean up the gear table Call this function to free the memory allocated for the gear table. | |
int | count_gear_in_db (const db_connection_t *db_connection) |
Count the number of gears in the database. |
Declares functions to load and free potion and gear tables from the game database, and count entries.
Definition in file item_database.h.
typedef struct gear_init_t gear_init_t |
To get gear table from the database, we need to define a struct This struct is for the initialization of the gear table The value of the struct corresponds to the init_gear() method in.
typedef struct potion_init_t potion_init_t |
To get potion table from the database, we need to define a struct This struct is for the initialization of the potion table The values of the struct corresponds to the init_potion() method in.
int count_gear_in_db | ( | const db_connection_t * | db_connection | ) |
Count the number of gears in the database.
db_connection | Pointer to the database connection |
Definition at line 206 of file item_database.c.
int count_potions_in_db | ( | const db_connection_t * | db_connection | ) |
Count the number of potions in the database.
db_connection | Pointer to the database connection |
Definition at line 108 of file item_database.c.
void free_gear_table_from_db | ( | gear_init_t * | gear_init_table, |
const db_connection_t * | db_connection ) |
Clean up the gear table Call this function to free the memory allocated for the gear table.
gear_init_table | Pointer to the gear table |
db_connection | Pointer to the database connection |
Definition at line 196 of file item_database.c.
void free_potion_table_from_db | ( | potion_init_t * | potion_init_table, |
const db_connection_t * | db_connection ) |
Clean up the potion table Call this function to free the memory allocated for the potion table.
potion_init_table | Pointer to the potion table |
db_connection | Pointer to the database connection |
Definition at line 98 of file item_database.c.
gear_init_t * init_gear_table_from_db | ( | const db_connection_t * | db_connection | ) |
Get the gear table from the database.
db_connection | Pointer to the database connection |
Definition at line 139 of file item_database.c.
potion_init_t * init_potion_table_from_db | ( | const db_connection_t * | db_connection | ) |
Get the potion table from the database.
db_connection | Pointer to the database connection |
Definition at line 51 of file item_database.c.