TreeSeblingBlock.h 1.5 KB

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