1 #ifndef BLANK_WORLD_BLOCKTYPEREGISTRY_HPP_
2 #define BLANK_WORLD_BLOCKTYPEREGISTRY_HPP_
4 #include "BlockType.hpp"
11 class BlockTypeRegistry {
17 Block::Type Add(const BlockType &);
19 size_t Size() const noexcept { return types.size(); }
21 BlockType &operator [](Block::Type id) { return types[id]; }
22 const BlockType &operator [](Block::Type id) const { return types[id]; }
24 BlockType &Get(Block::Type id) { return types[id]; }
25 const BlockType &Get(Block::Type id) const { return types[id]; }
28 std::vector<BlockType> types;