aboutsummaryrefslogtreecommitdiffstats
path: root/include/inventory.hpp
blob: fa24de4905c710f3854cfe77b42368f83ce839c5 (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
#ifndef INVENTORY_HPP_
#define INVENTORY_HPP_

#include <entityx/entityx.h>

#include <components.hpp>
#include <events.hpp>

struct Item {
    GLuint icon;
};

using InventoryEntry = std::pair<Item, unsigned int>;

class InventorySystem : public entityx::System<InventorySystem>, public entityx::Receiver<InventorySystem> {
private:
    entityx::Entity currentItemEntity;

    std::vector<InventoryEntry> items;
    unsigned int maxItemCount;

public:
    InventorySystem(unsigned int mic = 1)
        : maxItemCount(mic) {}

    void configure(entityx::EventManager &ev);

    void loadIcons(void);

    void update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) override;

    void receive(const KeyDownEvent &kde);
};

#endif // INVENTORY_HPP_