21 lines
383 B
C++
21 lines
383 B
C++
#pragma once
|
|
#include <vector>
|
|
#include "Item.h"
|
|
|
|
struct InventorySlot {
|
|
int itemId = 0;
|
|
int count = 0;
|
|
};
|
|
|
|
class Inventory {
|
|
public:
|
|
void addItem(int itemId, int count = 1);
|
|
bool removeItem(int itemId, int count = 1);
|
|
|
|
void show(const std::vector<Item>& itemDatabase) const;
|
|
|
|
bool hasItem(int itemId) const;
|
|
|
|
private:
|
|
std::vector<InventorySlot> items;
|
|
}; |