diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-06-11 21:11:37 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-06-11 21:11:37 +0200 |
commit | 30c560e271499cb461372a6798e53bf122a7495e (patch) | |
tree | 8d3022047c8b83d5a95e14c1fa488b0c8702be52 /plugins/inventory/inventory.h | |
parent | 14d315712d372932b27a118171865118a6b415c7 (diff) | |
download | dungeon_game-30c560e271499cb461372a6798e53bf122a7495e.tar.xz |
Add inventory and cherries (collectable food)
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 |