DimensionMap.h 914 B

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