#pragma once #include #include #include #include #include #include #include "Block.h" #include "Area.h" class Chunk : public Framework::Model3DCollection { private: Framework::Punkt location; // TODO: use native array for bedder performance? Framework::RCArray blocks; bool isLoading; Framework::Critical cs; public: Chunk(Framework::Punkt location); Chunk(Framework::Punkt location, Framework::StreamReader* zReader); ~Chunk(); void api(char* message); Block* zBlockAt(Framework::Vec3 cLocation); void setBlock(Block* block); void removeBlock(Block* zBlock); void load(Framework::StreamReader* zReader); Framework::Punkt getCenter() const; Framework::Vec3 getMin() const; Framework::Vec3 getMax() const; void forAll(std::function f) override; void updateVisibility(); };