MultiblockStructure.h 928 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <ReferenceCounter.h>
  3. #include <Punkt.h>
  4. #include "Block.h"
  5. class MultiblockStructure : public virtual Framework::ReferenceCounter
  6. {
  7. private:
  8. Framework::Array<Framework::Punkt> affectedChunks;
  9. Framework::Array<Framework::Vec3<int>> memberBlockPositions;
  10. Framework::Vec3<int> uniquePosition;
  11. int dimensionId;
  12. __int64 structureId;
  13. protected:
  14. Framework::RCArray<Block> loadedMembers;
  15. public:
  16. MultiblockStructure(int dimensionId, __int64 structureId, Framework::Vec3<int> uniquePosition);
  17. ~MultiblockStructure();
  18. void onBlockLoaded(Block* block);
  19. void onBlockUnloaded(Block* zBlock);
  20. void addMemberPosition(Framework::Vec3<int > blockPos);
  21. virtual void onBlockRemoved(Block* zBlock);
  22. bool isEmpty() const;
  23. bool isFullyLoaded() const;
  24. bool isFullyUnloaded() const;
  25. bool isBlockMember(Block* zBlock) const;
  26. __int64 getStructureId() const;
  27. Framework::Vec3<int> getUniquePosition() const;
  28. };