#pragma once #include #include #include #include "Chunk.h" #include "Entity.h" class World; class Dimension : public virtual Framework::ReferenceCounter { private: Framework::Trie* chunks; Framework::Array chunkList; Framework::RCArray* entities; Framework::Critical cs; void getAddrOf(Framework::Punkt cPos, char* addr) const; void getAddrOfWorld(Framework::Punkt wPos, char* addr) const; public: Dimension(); ~Dimension(); void api(char* message); Block* zBlock(Framework::Vec3 location); Block* getBlock(Framework::Vec3 location); void addEntity(Entity* entity); void setChunk(Chunk* chunk, Framework::Punkt center); bool hasChunck(int x, int y) const; Chunk* zChunk(Framework::Punkt wPos) const; void removeDistantChunks(Framework::Punkt wPos); void setBlock(Block* block); void removeBlock(Block* zBlock); Entity* zEntity(int id); Entity* getEntity(int id); void removeEntity(int id); };