BasicBlocks.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. friend DirtBlockType;
  15. };
  16. class DirtBlockType : public BlockType
  17. {
  18. REGISTRABLE( DirtBlockType )
  19. protected:
  20. DirtBlockType();
  21. virtual void loadSuperBlock( Block* zBlock, Framework::StreamReader* zReader ) override;
  22. public:
  23. virtual Block* createBlock( Framework::Vec3<int> position ) override;
  24. virtual void initializeSuperBlock( Block* zBlock ) override;
  25. virtual bool needsInstance() const override;
  26. };
  27. REGISTER( DirtBlockType, BlockType )
  28. class DirtBlockItemType : public BasicBlockItemType
  29. {
  30. REGISTRABLE( DirtBlockItemType )
  31. protected:
  32. DirtBlockItemType();
  33. public:
  34. virtual Item* createItem() const override;
  35. };
  36. REGISTER( DirtBlockItemType, ItemType )