TreeSeblingBlock.h 1.5 KB

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