123456789101112131415161718192021222324252627282930313233343536373839 |
- #pragma once
- #include <Array.h>
- #include <Trie.h>
- #include <Critical.h>
- #include "Chunk.h"
- #include "Entity.h"
- class World;
- class Dimension : public virtual Framework::ReferenceCounter
- {
- private:
- Framework::Trie<Chunk>* chunks;
- Framework::Array<Chunk*> chunkList;
- Framework::RCArray<Entity>* 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<int> location);
- Block* getBlock(Framework::Vec3<int> location);
- void addEntity(Entity* entity);
- void setChunk(Chunk* chunk, Framework::Punkt center, World* zWorld);
- bool hasChunck(int x, int y) const;
- Chunk* zChunk(Framework::Punkt wPos) const;
- void removeDistantChunks(Framework::Punkt wPos, World* zWorld);
- void setBlock(Block* block);
- void removeBlock(Block* zBlock);
- Entity* zEntity(int id);
- Entity* getEntity(int id);
- void removeEntity(int id);
- };
|