GeneratedStructure.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include <Either.h>
  3. #include <ReferenceCounter.h>
  4. #include <Vec3.h>
  5. #include "Block.h"
  6. class GeneratorTemplate;
  7. class MultiblockStructure;
  8. class GeneratedStructure : public Framework::ReferenceCounter
  9. {
  10. private:
  11. int* blockIds;
  12. Block** blocks;
  13. Framework::Vec3<int> size;
  14. Framework::Vec3<int> minAffectedPos;
  15. Framework::Vec3<int> originPos;
  16. GeneratorTemplate* t;
  17. MultiblockStructure* multiblock;
  18. public:
  19. GeneratedStructure(GeneratorTemplate* t,
  20. Framework::Vec3<int> originPos,
  21. Framework::Vec3<int> size,
  22. Framework::Vec3<int> minAffectedPos);
  23. ~GeneratedStructure();
  24. void setBlockAt(
  25. Framework::Either<Block*, int> block, Framework::Vec3<int> localPos);
  26. bool isBlockAffected(Framework::Vec3<int> location) const;
  27. Framework::Either<Block*, int> generateBlockAt(
  28. Framework::Vec3<int> location, int dimensionId) const;
  29. void addAllBlocksToStructure(MultiblockStructure* structure);
  30. Framework::Vec3<int> getOriginPos() const;
  31. GeneratorTemplate* zTemplate() const;
  32. };