diff options
Diffstat (limited to 'plugins/inventory/inventory.h')
-rw-r--r-- | plugins/inventory/inventory.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/inventory/inventory.h b/plugins/inventory/inventory.h new file mode 100644 index 0000000..4b13f94 --- /dev/null +++ b/plugins/inventory/inventory.h @@ -0,0 +1,30 @@ +#ifndef _INVENTORY_H_ +#define _INVENTORY_H_ +#include "../game/game.h" + +struct itemstack +{ + struct item *item; + int count; + void *meta; +}; + +struct item +{ + char *name; + bool stackable; + + bool (*on_use)(struct itemstack *stack); + void (*on_destroy)(struct itemstack *stack); +}; + +struct inventory +{ + struct list *stacks; +}; + +void inventory_add(struct inventory *self, struct itemstack stack); +bool inventory_remove(struct inventory *self, struct item *item); + +extern struct inventory player_inventory; +#endif |