Block.h 798 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include <Model3D.h>
  3. #include "BlockType.h"
  4. #include "Registries.h"
  5. #include "Area.h"
  6. using namespace Framework;
  7. class BasicBlockItemType;
  8. class Chunk;
  9. class Block : public Model3D
  10. {
  11. protected:
  12. bool transparent;
  13. float hp;
  14. float maxHP;
  15. const BlockType* zType;
  16. bool sideVisible[6];
  17. Vec3<int> location;
  18. Framework::Textur* breakTextur;
  19. public:
  20. Block(const BlockType* zType, Vec3<int> position, Model3DData* model, Model3DTextur* texture, int maxHp);
  21. virtual ~Block();
  22. void api(char* message);
  23. bool isTransparent() const;
  24. void setSideVisible(Direction dir, bool visible);
  25. Vec3<int> getLocation() const;
  26. const BlockType* zBlockType() const;
  27. Textur* zEffectTextur() override;
  28. float getEffectPercentage() override;
  29. friend Chunk;
  30. };