Добавлен инвентарь, в сундуках могут содержаться предметы.
This commit is contained in:
21
include/inventory.h
Normal file
21
include/inventory.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#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;
|
||||
};
|
||||
Reference in New Issue
Block a user