123456789101112131415161718192021222324 |
- #include "BlockRegistry.h"
- Block BlockRegistry::NULL_BLOCK(0);
- BlockRegistry::BlockRegistry() : idCounter(1)
- {
-
- }
- const Block& BlockRegistry::getBlock(const std::string& name) const
- {
- const std::unordered_map<std::string, Block>::const_iterator& iter = registry.find(name);
- if(iter == registry.end())
- {
- return NULL_BLOCK;
- }
- return iter->second;
- }
- const Block& BlockRegistry::getBlock(BlockId id) const
- {
- return NULL_BLOCK;
- }
|