#pragma once #include #include "Inventory.h" #include "Chunk.h" #include "BlockType.h" using namespace Framework; class BasicBlockItemType; #define AIR_BLOCK -1 #define IS_BLOCK(b) (((__int64)b) > 0) class Block : public Model3D, public Inventory { private: bool visible; bool transparent; bool passable; float hp; float maxHP; float hardness; float speedModifier; ItemType *zTool; Block *zNeighbours[ 6 ]; public: Block( ItemType *zTool, Vec3 position ); virtual ~Block(); bool updateVisibility(); virtual void setNeighbour( Direction dir, Block *zN ); bool isVisible() 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; };