DimensionMap.h 961 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include <Array.h>
  3. #include <InMemoryBuffer.h>
  4. #include <ReferenceCounter.h>
  5. #include <Trie.h>
  6. #include <Critical.h>
  7. #include <Punkt.h>
  8. class Dimension;
  9. class NetworkMessage;
  10. class Entity;
  11. class ChunkMap;
  12. class Chunk;
  13. class DimensionMap : public Framework::ReferenceCounter
  14. {
  15. private:
  16. Framework::RCTrie<ChunkMap>* chunks;
  17. Framework::Critical cs;
  18. Framework::Array<int> observers;
  19. int dimensionId;
  20. ChunkMap* load(Framework::Punkt chunkCenter);
  21. public:
  22. DimensionMap(int dimensionId);
  23. ~DimensionMap();
  24. void api(Framework::InMemoryBuffer* zRequest,
  25. NetworkMessage* zResponse,
  26. Entity* zSource,
  27. Dimension* zDimension);
  28. void loadMap(char* addr, int addrLen, Chunk* zChunk);
  29. void onMapUpdated(char* addr, int addrLen);
  30. void saveMap(char* addr, int addrLen);
  31. void removeMap(char* addr, int addrLen);
  32. ChunkMap* getMap(char* addr, int addrLen, Framework::Punkt chunkCenter);
  33. };