123456789101112131415161718192021222324252627282930313233343536373839 |
- #pragma once
- #include <Vec3.h>
- #include <Array.h>
- #include <Writer.h>
- #include <Either.h>
- #include "StaticRegistry.h"
- class Item;
- class Block;
- class BlockType : public virtual Framework::ReferenceCounter
- {
- private:
- const int id;
- protected:
- Block* defaultBlock;
- BlockType( int id, Block* defaultBlock );
- virtual ~BlockType();
- virtual void loadSuperBlock( Block* zBlock, Framework::StreamReader* zReader ) const;
- virtual void saveSuperBlock( Block* zBlock, Framework::StreamWriter* zWriter ) const;
- virtual void createSuperBlock( Block* zBlock, Item* zItem ) const;
- virtual void createSuperItem( Block* zBlock, Item* zItem ) const;
- virtual Block* createBlock( Framework::Vec3<int> position ) const = 0;
- virtual Item* createItem() const = 0;
- public:
- virtual Block* loadBlock( Framework::Vec3<int> position, Framework::StreamReader* zReader ) const;
- virtual void saveBlock( Block* zBlock, Framework::StreamWriter* zWriter ) const;
- virtual Item* getItemFromBlock( Block* zBlock ) const;
- virtual Block* createBlockAt( Framework::Vec3<int> position, Item* zUsedItem ) const;
- virtual const Block* zDefault() const;
- int getId() const;
- };
- const Block* getDefaultBlock( Framework::Either<Block*, int> b );
|