#ifndef BLOCKREGISTRY_H #define BLOCKREGISTRY_H #include "common/block/Block.h" #include "common/block/BlockTypes.h" #include "gaming-core/utils/HashMap.h" #include "gaming-core/utils/List.h" class BlockRegistry final { public: BlockRegistry(); void forEach(void (*f)(const Block&)) const; const Block& getBlock(const BlockName& registry) const; const Block& getBlock(BlockId id) const; private: void add(const char* registry); List blocks; HashMap registryToId; }; #endif