12345678910111213141516171819202122232425262728293031 |
- #ifndef BLOCKS_H
- #define BLOCKS_H
- #include "Block.h"
- #include "BlockAir.h"
- class BlockRegistry
- {
- public:
- static const Block& getBlockFromId(BlockId id);
- static void registerBlocks();
-
- private:
- BlockRegistry();
- static void init();
- static void registerBlock(const Block& block);
-
- static const int BLOCK_AMOUNT;
- static const Block* BLOCKS[];
- };
- namespace Blocks
- {
- extern const BlockAir AIR;
- extern const Block GRASS;
- extern const Block DIRT;
- extern const Block STONE;
- };
- #endif
|