#pragma once #include #include #include "Inventory.h" #include "BlockType.h" #include "Registries.h" using namespace Framework; #define CONST_BLOCK(maybeBlock, type) (maybeBlock ? maybeBlock : STATIC_REGISTRY( BlockType ).zElement((int)type)->zDefault()) class BasicBlockItemType; class Chunk; class Block : public Model3D, public Inventory { protected: bool transparent; bool passable; float hp; float maxHP; float hardness; float speedModifier; const BlockType* zType; ItemType* zTool; public: Block( const BlockType* zType, ItemType* zTool, Vec3 position, bool hasInventory ); virtual ~Block(); bool isTransparent() const; const BlockType* zBlockType() const; friend Chunk; friend BlockType; }; class BasicBlockItem : public Item { protected: bool transparent; bool passable; float hp; float maxHP; float hardness; int toolId; float speedModifier; public: BasicBlockItem( const ItemType* zType, const char* name ); friend BasicBlockItemType; friend BlockType; }; class BasicBlockItemType : public ItemType { protected: BasicBlockItemType( int id ); virtual void loadSuperItem( Item* zItem, Framework::StreamReader* zReader ) const override; };