blob: 15877e93978975a4a15c31e8882e8b5bfc8a7e8d (
plain)
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
39
40
41
|
#ifndef INVENTORY_HPP_
#define INVENTORY_HPP_
#include <entityx/entityx.h>
#include <components.hpp>
#include <events.hpp>
struct InventoryEntry {
GLuint icon;
std::string name;
std::string type;
int count;
int max;
vec2 loc;
};
class InventorySystem : public entityx::System<InventorySystem>, public entityx::Receiver<InventorySystem> {
private:
entityx::Entity currentItemEntity;
std::vector<InventoryEntry> items;
public:
InventorySystem(int size = 4) {
items.resize(size);
loadItems();
}
void configure(entityx::EventManager &ev);
void loadItems(void);
void update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) override;
void receive(const KeyDownEvent &kde);
void render(void);
};
#endif // INVENTORY_HPP_
|