TreeSeblingBlock.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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(const BlockType* zType, 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. protected:
  22. bool transparent;
  23. bool passable;
  24. float hardness;
  25. const ItemType* zTool;
  26. float speedModifier;
  27. bool interactable;
  28. TreeSeblingBlockType(int typeId, int itemTypeId, ModelInfo model);
  29. virtual void createSuperBlock(Block* zBlock, Item* zItem) const override;
  30. virtual void loadSuperBlock(Block* zBlock, Framework::StreamReader* zReader, int dimensionId) const override;
  31. virtual void saveSuperBlock(Block* zBlock, Framework::StreamWriter* zWriter) const override;
  32. virtual Item* createItem() const override;
  33. };
  34. class OakSeblingBlockType : public TreeSeblingBlockType
  35. {
  36. REGISTRABLE(OakSeblingBlockType)
  37. protected:
  38. OakSeblingBlockType();
  39. public:
  40. virtual Block* createBlock(Framework::Vec3<int> position) const override;
  41. };
  42. REGISTER(OakSeblingBlockType, BlockType)
  43. class BirchSeblingBlockType : public TreeSeblingBlockType
  44. {
  45. REGISTRABLE(BirchSeblingBlockType)
  46. protected:
  47. BirchSeblingBlockType();
  48. public:
  49. virtual Block* createBlock(Framework::Vec3<int> position) const override;
  50. };
  51. REGISTER(BirchSeblingBlockType, BlockType)
  52. class BeechSeblingBlockType : public TreeSeblingBlockType
  53. {
  54. REGISTRABLE(BeechSeblingBlockType)
  55. protected:
  56. BeechSeblingBlockType();
  57. public:
  58. virtual Block* createBlock(Framework::Vec3<int> position) const override;
  59. };
  60. REGISTER(BeechSeblingBlockType, BlockType)
  61. class PineSeblingBlockType : public TreeSeblingBlockType
  62. {
  63. REGISTRABLE(PineSeblingBlockType)
  64. protected:
  65. PineSeblingBlockType();
  66. public:
  67. virtual Block* createBlock(Framework::Vec3<int> position) const override;
  68. };
  69. REGISTER(PineSeblingBlockType, BlockType)