DungeonCrawl
Loading...
Searching...
No Matches
item_database.h
Go to the documentation of this file.
1
5#ifndef ITEM_DATABASE_H
6#define ITEM_DATABASE_H
7
9#include "../../item/gear.h"
10#include "../../item/potion.h"
11#include "../database.h"
12
18typedef struct potion_init_t {
19 int potion_type;// The index of the potion in the table
20 char* name;
21 int value;
23
29
30typedef struct gear_init_t {
31 char* name;
32 gear_identifier_t gear_identifier;
33 gear_slot_t slot;
34 stats_t stats;
35 defenses_t defenses;
36 ability_names_t ability_names[MAX_ABILITY_PER_GEAR];
37 int num_abilities;
46
54void free_potion_table_from_db(potion_init_t* potion_init_table, const db_connection_t* db_connection);
55
62int count_potions_in_db(const db_connection_t* db_connection);
63
71
79void free_gear_table_from_db(gear_init_t* gear_init_table, const db_connection_t* db_connection);
80
87int count_gear_in_db(const db_connection_t* db_connection);
88
89#endif//ITEM_DATABASE_H
Exposes functions for working with abilities.
Exposes functions for working with the database.
Exposes functions for working with gear.
gear_init_t * init_gear_table_from_db(const db_connection_t *db_connection)
Get the gear table from the database.
potion_init_t * init_potion_table_from_db(const db_connection_t *db_connection)
Get the potion 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_potions_in_db(const db_connection_t *db_connection)
Count the number of potions in the database.
int count_gear_in_db(const db_connection_t *db_connection)
Count the number of gears in 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.
Exposes functions for working with potions.
This struct is used for the database connection in SQLite.
Definition database.h:22
To get gear table from the database, we need to define a struct This struct is for the initialization...
To get potion table from the database, we need to define a struct This struct is for the initializati...