123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- #pragma once
- #include "Block.h"
- #include "BlockType.h"
- #include "Item.h"
- class BlockType;
- class ItemType;
- class BasicBlockType;
- class BasicBlock : public Block
- {
- public:
- BasicBlock(const BlockType* zType, ItemType* zTool, Framework::Vec3<int> pos);
- virtual bool onTick(TickQueue* zQueue, int numTicks, bool& blocked) override;
- virtual void onPostTick() override;
- friend BasicBlockType;
- };
- class BasicBlockType : public BlockType
- {
- private:
- int itemType;
- protected:
- bool transparent;
- bool passable;
- float hardness;
- ItemType* zTool;
- float speedModifier;
- bool interactable;
- BasicBlockType(int typeId, int itemTypeId, ModelInfo model);
- virtual void createSuperBlock(Block* zBlock, Item* zItem) const override;
- public:
- virtual Block* createBlock(Framework::Vec3<int> position) const override;
- virtual Item* createItem() const override;
- };
- // Dirt
- class DirtBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(DirtBlockItemType)
- protected:
- DirtBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(DirtBlockItemType, ItemType)
- class DirtBlockType : public BasicBlockType
- {
- REGISTRABLE(DirtBlockType)
- protected:
- DirtBlockType();
- };
- REGISTER(DirtBlockType, BlockType)
- // Stone
- class StoneBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(StoneBlockItemType)
- protected:
- StoneBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(StoneBlockItemType, ItemType)
- class StoneBlockType : public BasicBlockType
- {
- REGISTRABLE(StoneBlockType)
- protected:
- StoneBlockType();
- };
- REGISTER(StoneBlockType, BlockType)
- // Sand
- class SandBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(SandBlockItemType)
- protected:
- SandBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(SandBlockItemType, ItemType)
- class SandBlockType : public BasicBlockType
- {
- REGISTRABLE(SandBlockType)
- protected:
- SandBlockType();
- };
- REGISTER(SandBlockType, BlockType)
- // Oak Wood
- class OakBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(OakBlockItemType)
- protected:
- OakBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(OakBlockItemType, ItemType)
- class OakBlockType : public BasicBlockType
- {
- REGISTRABLE(OakBlockType)
- protected:
- OakBlockType();
- };
- REGISTER(OakBlockType, BlockType)
- // Leaves
- class LeavesBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(LeavesBlockItemType)
- protected:
- LeavesBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(LeavesBlockItemType, ItemType)
- class LeavesBlockType : public BasicBlockType
- {
- REGISTRABLE(LeavesBlockType)
- protected:
- LeavesBlockType();
- };
- REGISTER(LeavesBlockType, BlockType)
- // Gravel
- class GravelBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(GravelBlockItemType)
- protected:
- GravelBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(GravelBlockItemType, ItemType)
- class GravelBlockType : public BasicBlockType
- {
- REGISTRABLE(GravelBlockType)
- protected:
- GravelBlockType();
- };
- REGISTER(GravelBlockType, BlockType)
- // Granite
- class GraniteBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(GraniteBlockItemType)
- protected:
- GraniteBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(GraniteBlockItemType, ItemType)
- class GraniteBlockType : public BasicBlockType
- {
- REGISTRABLE(GraniteBlockType)
- protected:
- GraniteBlockType();
- };
- REGISTER(GraniteBlockType, BlockType)
- // Cobble
- class CobbleBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(CobbleBlockItemType)
- protected:
- CobbleBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(CobbleBlockItemType, ItemType)
- class CobbleBlockType : public BasicBlockType
- {
- REGISTRABLE(CobbleBlockType)
- protected:
- CobbleBlockType();
- };
- REGISTER(CobbleBlockType, BlockType)
- // Birch Wood
- class BirchBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(BirchBlockItemType)
- protected:
- BirchBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(BirchBlockItemType, ItemType)
- class BirchBlockType : public BasicBlockType
- {
- REGISTRABLE(BirchBlockType)
- protected:
- BirchBlockType();
- };
- REGISTER(BirchBlockType, BlockType)
- // Beech Wood
- class BeechBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(BeechBlockItemType)
- protected:
- BeechBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(BeechBlockItemType, ItemType)
- class BeechBlockType : public BasicBlockType
- {
- REGISTRABLE(BeechBlockType)
- protected:
- BeechBlockType();
- };
- REGISTER(BeechBlockType, BlockType)
- // Basalt
- class BasaltBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(BasaltBlockItemType)
- protected:
- BasaltBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(BasaltBlockItemType, ItemType)
- class BasaltBlockType : public BasicBlockType
- {
- REGISTRABLE(BasaltBlockType)
- protected:
- BasaltBlockType();
- };
- REGISTER(BasaltBlockType, BlockType)
- // Pine
- class PineBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(PineBlockItemType)
- protected:
- PineBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(PineBlockItemType, ItemType)
- class PineBlockType : public BasicBlockType
- {
- REGISTRABLE(PineBlockType)
- protected:
- PineBlockType();
- };
- REGISTER(PineBlockType, BlockType)
|