GeneratedStructure.h 899 B

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