#ifndef BLOCKREGISTRY_H #define BLOCKREGISTRY_H #include #include #include "common/utils/HashedString.h" #include "common/block/Block.h" class BlockRegistry final { public: BlockRegistry(); const Block& getBlock(const HashedString& registry) const; const Block& getBlock(u16 id) const; private: void add(const char* registry, const BlockBuilder& builder); std::vector blocks; std::unordered_map registryToId; }; #endif