GeneratedStructure.h 976 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <ReferenceCounter.h>
  3. #include <Vec3.h>
  4. #include <Either.h>
  5. #include "Block.h"
  6. class GenerationTemplate;
  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. GenerationTemplate* t;
  17. MultiblockStructure* multiblock;
  18. public:
  19. GeneratedStructure(GenerationTemplate* t, Framework::Vec3<int> originPos, Framework::Vec3<int> size, Framework::Vec3<int> minAffectedPos);
  20. ~GeneratedStructure();
  21. void setBlockAt(Framework::Either<Block*, int> block, Framework::Vec3<int> localPos);
  22. bool isBlockAffected(Framework::Vec3<int> location) const;
  23. Framework::Either<Block*, int> generateBlockAt(Framework::Vec3<int> location) const;
  24. void addAllBlocksToStructure(MultiblockStructure* structure);
  25. Framework::Vec3<int> getOriginPos() const;
  26. GenerationTemplate* zTemplate() const;
  27. };