TreeSeblingBlock.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include "Block.h"
  3. class TreeSeblingBlockType;
  4. class TreeSeblingBlock : public Block
  5. {
  6. private:
  7. float seblingTicks;
  8. int seblingTicksMax;
  9. const BlockType* wood;
  10. const BlockType* leaves;
  11. public:
  12. TreeSeblingBlock(int typeId, const ItemType* zTool, Framework::Vec3<int> pos, const BlockType* wood, const BlockType* leaves);
  13. virtual bool onTick(TickQueue* zQueue, int numTicks, bool& blocked) override;
  14. virtual void onPostTick() override;
  15. friend TreeSeblingBlockType;
  16. };
  17. class TreeSeblingBlockType : public BlockType
  18. {
  19. private:
  20. int itemType;
  21. bool transparent;
  22. bool passable;
  23. float hardness;
  24. const ItemType* zTool;
  25. float speedModifier;
  26. bool interactable;
  27. int woodType;
  28. int leavesType;
  29. protected:
  30. virtual void createSuperBlock(Block* zBlock, Item* zItem) const override;
  31. virtual void loadSuperBlock(Block* zBlock, Framework::StreamReader* zReader, int dimensionId) const override;
  32. virtual void saveSuperBlock(Block* zBlock, Framework::StreamWriter* zWriter) const override;
  33. virtual Item* createItem() const override;
  34. virtual Block* createBlock(Framework::Vec3<int> position) const override;
  35. public:
  36. TreeSeblingBlockType(int typeId, int itemTypeId, ModelInfo model, int woodType, int leavesType);
  37. TreeSeblingBlockType* setHardness(float hardness);
  38. };