123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453 |
- #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;
- };
- struct SpawnConfig
- {
- int min;
- int max;
- double chance;
- int itemType;
- };
- class AdditionalItemSpawningBlock : public BasicBlock
- {
- private:
- Framework::Array< SpawnConfig> spawns;
- public:
- AdditionalItemSpawningBlock(const BlockType* zType, ItemType* zTool, Framework::Vec3<int> pos);
- void addSpawn(SpawnConfig config);
- virtual void onDestroy() override;
- };
- 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)
- // Oak Leaves
- class OakLeavesBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(OakLeavesBlockItemType)
- protected:
- OakLeavesBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(OakLeavesBlockItemType, ItemType)
- class OakLeavesBlockType : public BasicBlockType
- {
- REGISTRABLE(OakLeavesBlockType)
- protected:
- OakLeavesBlockType();
- public:
- virtual Block* createBlock(Framework::Vec3<int> position) const override;
- };
- REGISTER(OakLeavesBlockType, BlockType)
- // Oak Sebling
- class OakSeblingBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(OakSeblingBlockItemType)
- protected:
- OakSeblingBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(OakSeblingBlockItemType, ItemType)
- // 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)
- // Birch Leaves
- class BirchLeavesBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(BirchLeavesBlockItemType)
- protected:
- BirchLeavesBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(BirchLeavesBlockItemType, ItemType)
- class BirchLeavesBlockType : public BasicBlockType
- {
- REGISTRABLE(BirchLeavesBlockType)
- protected:
- BirchLeavesBlockType();
- public:
- virtual Block* createBlock(Framework::Vec3<int> position) const override;
- };
- REGISTER(BirchLeavesBlockType, BlockType)
- // Birch Sebling
- class BirchSeblingBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(BirchSeblingBlockItemType)
- protected:
- BirchSeblingBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(BirchSeblingBlockItemType, ItemType)
- // 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)
- // Beech Leaves
- class BeechLeavesBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(BeechLeavesBlockItemType)
- protected:
- BeechLeavesBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(BeechLeavesBlockItemType, ItemType)
- class BeechLeavesBlockType : public BasicBlockType
- {
- REGISTRABLE(BeechLeavesBlockType)
- protected:
- BeechLeavesBlockType();
- public:
- virtual Block* createBlock(Framework::Vec3<int> position) const override;
- };
- REGISTER(BeechLeavesBlockType, BlockType)
- // Beech Sebling
- class BeechSeblingBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(BeechSeblingBlockItemType)
- protected:
- BeechSeblingBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(BeechSeblingBlockItemType, ItemType)
- // 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)
- // Pine Leaves
- class PineLeavesBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(PineLeavesBlockItemType)
- protected:
- PineLeavesBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(PineLeavesBlockItemType, ItemType)
- class PineLeavesBlockType : public BasicBlockType
- {
- REGISTRABLE(PineLeavesBlockType)
- protected:
- PineLeavesBlockType();
- public:
- virtual Block* createBlock(Framework::Vec3<int> position) const override;
- };
- REGISTER(PineLeavesBlockType, BlockType)
- // Pine Sebling
- class PineSeblingBlockItemType : public BasicBlockItemType
- {
- REGISTRABLE(PineSeblingBlockItemType)
- protected:
- PineSeblingBlockItemType();
- public:
- virtual Item* createItem() const override;
- };
- REGISTER(PineSeblingBlockItemType, ItemType)
|