Working on translations

This commit is contained in:
Vladislav Khorev committed 2026-07-07 11:24:21 +03:00
1 parent 9d8ca865c7
commit e2d9105b02
18 files changed
+271 -88

No files matched your search

+9 -5
View File
@@ -22,13 +22,14 @@ namespace ZL {
class Inventory : public ISaveable {
public:
std::vector<Item> items;
void addItem(const Item& item);
void addItem(const std::string& itemId);
void removeItem(const std::string& itemId);
const std::vector<Item>& getItems() const { return items; }
// Resolves current items from ItemRegistry by id, so returned data
// always reflects the currently loaded (localized) definitions.
std::vector<Item> getItems() const;
bool hasItem(const std::string& itemId) const;
void clear() { items.clear(); }
size_t getCount() const { return items.size(); }
void clear() { itemIds.clear(); }
size_t getCount() const { return itemIds.size(); }
void save(nlohmann::json& out) const override;
void load(const nlohmann::json& in) override;
@@ -36,6 +37,9 @@ namespace ZL {
// Called whenever an item is added/removed; receives the item id.
std::function<void(const std::string&)> onItemAdded;
std::function<void(const std::string&)> onItemRemoved;
private:
std::vector<std::string> itemIds;
};
} // namespace ZL