BasicBlocks.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include <Textur.h>
  3. #include "Block.h"
  4. #include "BlockType.h"
  5. #include "Item.h"
  6. class BlockType;
  7. class ItemType;
  8. class DirtBlockType;
  9. class DirtBlockItemType;
  10. class BasicBlock : public Block
  11. {
  12. public:
  13. BasicBlock( const BlockType* zType, const char* texture, ItemType* zTool, Framework::Vec3<int> pos, Framework::Textur* t );
  14. bool needRenderPolygon( int index ) override;
  15. friend DirtBlockType;
  16. };
  17. class DirtBlockType : public BlockType
  18. {
  19. REGISTRABLE( DirtBlockType )
  20. protected:
  21. DirtBlockType();
  22. virtual void loadSuperBlock( Block* zBlock, Framework::StreamReader* zReader ) override;
  23. public:
  24. virtual Block* createBlock( Framework::Vec3<int> position ) override;
  25. virtual void initializeSuperBlock( Block* zBlock ) override;
  26. virtual bool needsInstance() const override;
  27. };
  28. REGISTER( DirtBlockType, BlockType )
  29. class DirtBlockItemType : public BasicBlockItemType
  30. {
  31. REGISTRABLE( DirtBlockItemType )
  32. protected:
  33. DirtBlockItemType();
  34. public:
  35. virtual Item* createItem() const override;
  36. };
  37. REGISTER( DirtBlockItemType, ItemType )