format Inventories.hpp

This commit is contained in:
MihailRis 2025-12-16 00:39:30 +03:00
parent c394df4e07
commit 923ca2b89e

View file

@ -11,7 +11,7 @@ class Level;
using inventories_map = std::unordered_map<int64_t, std::shared_ptr<Inventory>>; using inventories_map = std::unordered_map<int64_t, std::shared_ptr<Inventory>>;
/* Inventories runtime storage */ /// @brief Inventories runtime storage
class Inventories { class Inventories {
Level& level; Level& level;
inventories_map map; inventories_map map;
@ -20,21 +20,22 @@ public:
Inventories(Level& level); Inventories(Level& level);
~Inventories(); ~Inventories();
/* Create new inventory with new id */ /// @brief Create new inventory with new id
std::shared_ptr<Inventory> create(size_t size); std::shared_ptr<Inventory> create(size_t size);
/* Create runtime-only inventory (has negative id) */ /// @brief Create runtime-only inventory (has negative id)
std::shared_ptr<Inventory> createVirtual(size_t size); std::shared_ptr<Inventory> createVirtual(size_t size);
/* Store inventory */ /// @brief Store inventory
void store(const std::shared_ptr<Inventory>& inv); void store(const std::shared_ptr<Inventory>& inv);
/* Remove inventory from map */ /// @brief Remove inventory from map
void remove(int64_t id); void remove(int64_t id);
/* Get inventory by id (works with both real and virtual)*/ /// @brief Get inventory by id (works with both real and virtual)
std::shared_ptr<Inventory> get(int64_t id); std::shared_ptr<Inventory> get(int64_t id);
/// @brief Create inventory non-virtual copy
std::shared_ptr<Inventory> clone(int64_t id); std::shared_ptr<Inventory> clone(int64_t id);
const inventories_map& getMap() const; const inventories_map& getMap() const;