Block.h 871 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. char lightData[6 * 6];
  20. public:
  21. Block(const BlockType* zType, Vec3<int> position, Model3DData* model, Model3DTextur* texture, int maxHp);
  22. virtual ~Block();
  23. void api(char* message);
  24. bool isTransparent() const;
  25. void setSideVisible(Direction dir, bool visible);
  26. void setLightData(Direction dir, char* data);
  27. Vec3<int> getLocation() const;
  28. const BlockType* zBlockType() const;
  29. Textur* zEffectTextur() override;
  30. float getEffectPercentage() override;
  31. friend Chunk;
  32. };