12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #pragma once
- #include <Model3D.h>
- #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<int> 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;
- };
|