Добавлен инвентарь, в сундуках могут содержаться предметы.

This commit is contained in:
DeLiss
2026-06-11 12:05:36 +05:00
parent cba2274630
commit 5d4940f754
12 changed files with 312 additions and 8 deletions

21
include/inventory.h Normal file
View 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;
};