#pragma once
#include <string>
#include <unordered_map>
#include "Item.h"

namespace ZL {

class ItemRegistry {
public:
    static ItemRegistry& instance();

    void loadFromJson(const std::string& jsonPath, const std::string& zipPath = "");

    // Returns nullptr if not found.
    const Item* findById(const std::string& id) const;

private:
    ItemRegistry() = default;

    std::unordered_map<std::string, Item> items_;
};

} // namespace ZL
