1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #pragma once
- #include <Model3D.h>
- #include "BlockType.h"
- #include "Registries.h"
- #include "Area.h"
- using namespace Framework;
- class BasicBlockItemType;
- class Chunk;
- class Block : public Model3D
- {
- protected:
- bool transparent;
- float hp;
- float maxHP;
- const BlockType* zType;
- bool sideVisible[6];
- Vec3<int> location;
- Framework::Textur* breakTextur;
- unsigned char lightData[6 * 6];
- char lightBuffer[24 * 4];
- void beforeRender(GraphicsApi* api, Shader* zVertexShader, Shader* zPixelShader) override;
- void afterRender(GraphicsApi* api, Shader* zVertexShader, Shader* zPixelShader) override;
- public:
- Block(const BlockType* zType, Vec3<int> position, Model3DData* model, Model3DTextur* texture, int maxHp);
- virtual ~Block();
- void api(char* message);
- bool isTransparent() const;
- void setSideVisible(Direction dir, bool visible);
- void setLightData(Direction dir, unsigned char* data);
- Vec3<int> getLocation() const;
- const BlockType* zBlockType() const;
- Textur* zEffectTextur() override;
- float getEffectPercentage() override;
- friend Chunk;
- Text printLightInfo();
- };
|