#pragma once #include "Block.h" #include "BlockType.h" #include "Item.h" class BlockType; class ItemType; class BasicBlockType; class BasicBlock : public Block { public: BasicBlock(int typeId, ItemType* zTool, Framework::Vec3 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(int typeId, ItemType* zTool, Framework::Vec3 pos); void addSpawn(SpawnConfig config); virtual void onDestroy() override; }; class BasicBlockType : public BlockType { private: int itemType; bool transparent; bool passable; float hardness; ItemType* zTool; float speedModifier; bool interactable; std::function)> creatBlockCustom; protected: virtual void createSuperBlock(Block* zBlock, Item* zItem) const override; public: BasicBlockType(int typeId, int itemTypeId, ModelInfo model); BasicBlockType(int typeId, int itemTypeId, ModelInfo model, std::function)> creatBlockCustom); virtual Block* createBlock(Framework::Vec3 position) const override; virtual Item* createItem() const override; BasicBlockType* setHardness(float hardness); };