Chunk.h 892 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <Punkt.h>
  3. #include <Model3DCollection.h>
  4. #include <Reader.h>
  5. #include <Model3D.h>
  6. #include <Array.h>
  7. #include <Critical.h>
  8. #include "Block.h"
  9. #include "Area.h"
  10. class Chunk : public Framework::Model3DCollection
  11. {
  12. private:
  13. Framework::Punkt location;
  14. Framework::RCArray<Block> blocks;
  15. bool isLoading;
  16. Framework::Critical cs;
  17. public:
  18. Chunk(Framework::Punkt location);
  19. Chunk(Framework::Punkt location, Framework::StreamReader* zReader);
  20. ~Chunk();
  21. void api(char* message);
  22. Block* zBlockAt(Framework::Vec3<int> cLocation);
  23. void setBlock(Block* block);
  24. void removeBlock(Block* zBlock);
  25. void load(Framework::StreamReader* zReader);
  26. Framework::Punkt getCenter() const;
  27. Framework::Vec3<int> getMin() const;
  28. Framework::Vec3<int> getMax() const;
  29. void forAll(std::function<void(Model3D*)> f) override;
  30. void updateVisibility();
  31. };