-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem.h
38 lines (29 loc) · 952 Bytes
/
item.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef ITEM_H_DEFINED
#define ITEM_H_DEFINED
#include "actor.h.const"
#include "draw.h.const"
#define ITEM_OPERATIONS_SIZE HUD_ROWS
#define ALL_ITEMS_SIZE ACTOR_INVENTORY_SIZE * ALL_ACTORS_SIZE
struct item {
int amount;
char consumable;
char name[32];
int all_items_index;
int suitable_equipment_slot;
/* int supported_item_operations[ITEM_OPERATIONS_SIZE] */
};
struct item_operation {
char name[32];
void (*apply) (struct item* const subject);
};
extern struct item* g_selected_item;
extern struct item* g_all_items[ALL_ITEMS_SIZE];
extern struct item_operation* g_item_operations[ITEM_OPERATIONS_SIZE];
struct item** get_all_items(void);
struct item* get_selected_item(void);
void set_selected_item(struct item* new_item);
struct item_operation* get_item_operation(int index);
void apply_operation_use(struct item* subject);
void apply_operation_equip(struct item* subject);
void apply_operation_drop(struct item* subject);
#endif