#include "Inventory.h" #include // Для std::remove_if namespace ZL { // Определяем глобальный инвентарь std::vector gInventory; void AddItemToInventory(const std::string& name, std::shared_ptr tex) { gInventory.push_back({ name, tex }); } void RemoveItemFromInventory(const std::string& name) { gInventory.erase( std::remove_if(gInventory.begin(), gInventory.end(), [&name](const InventoryItem& item) { return item.name == name; }), gInventory.end()); } void PrintInventory() { for (const auto& item : gInventory) { std::cout << "Item: " << item.name << ", texture ID = " << (item.texture ? item.texture->getTexID() : 0) << std::endl; } } const std::vector& ReturnInventory() { return gInventory; } }