]> git.localhorst.tv Git - blank.git/blobdiff - src/world/BlockTypeRegistry.hpp
try to cleanly destruct world
[blank.git] / src / world / BlockTypeRegistry.hpp
index 0a1ebf0ebc4f31a369fdc5eada961d12eef4d093..9d9597dde0716348245f8a3e4d0622b008b50d8c 100644 (file)
@@ -11,14 +11,28 @@ namespace blank {
 class BlockTypeRegistry {
 
 public:
-       BlockTypeRegistry();
+       using size_type = std::vector<BlockType>::size_type;
+       using reference = std::vector<BlockType>::reference;
+       using const_reference = std::vector<BlockType>::const_reference;
+       using iterator = std::vector<BlockType>::iterator;
+       using const_iterator = std::vector<BlockType>::const_iterator;
 
 public:
+       BlockTypeRegistry();
+
        Block::Type Add(const BlockType &);
 
-       size_t Size() const noexcept { return types.size(); }
+       size_t size() const noexcept { return types.size(); }
+
+       iterator begin() noexcept { return types.begin(); }
+       const_iterator begin() const noexcept { return types.begin(); }
+       iterator end() noexcept { return types.end(); }
+       const_iterator end() const noexcept { return types.end(); }
 
        BlockType &operator [](Block::Type id) { return types[id]; }
+       const BlockType &operator [](Block::Type id) const { return types[id]; }
+
+       BlockType &Get(Block::Type id) { return types[id]; }
        const BlockType &Get(Block::Type id) const { return types[id]; }
 
 private: