TreeSeblingBlock.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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,
  13. const ItemType* zTool,
  14. Framework::Vec3<int> pos,
  15. const BlockType* wood,
  16. const BlockType* leaves);
  17. virtual bool onTick(
  18. TickQueue* zQueue, int numTicks, bool& blocked) override;
  19. virtual void onPostTick() override;
  20. friend TreeSeblingBlockType;
  21. };
  22. class TreeSeblingBlockType : public BlockType
  23. {
  24. private:
  25. int itemType;
  26. bool transparent;
  27. bool passable;
  28. float hardness;
  29. const ItemType* zTool;
  30. float speedModifier;
  31. bool interactable;
  32. int woodType;
  33. int leavesType;
  34. protected:
  35. virtual void createSuperBlock(Block* zBlock, Item* zItem) const override;
  36. virtual void loadSuperBlock(Block* zBlock,
  37. Framework::StreamReader* zReader,
  38. int dimensionId) const override;
  39. virtual void saveSuperBlock(
  40. Block* zBlock, Framework::StreamWriter* zWriter) const override;
  41. virtual Item* createItem() const override;
  42. virtual Block* createBlock(Framework::Vec3<int> position) const override;
  43. public:
  44. TreeSeblingBlockType(int typeId,
  45. int itemTypeId,
  46. ModelInfo model,
  47. int woodType,
  48. int leavesType);
  49. TreeSeblingBlockType* setHardness(float hardness);
  50. };