46 for (cChunkCoordsVector::const_iterator itr =
m_Chunks.begin(); itr !=
m_Chunks.end(); ++itr)
48 if ((itr->m_ChunkX == a_ChunkX) && (itr->m_ChunkZ == a_ChunkZ))
54 m_Chunks.emplace_back(a_ChunkX, a_ChunkZ);
65 for (cChunkCoordsVector::iterator itr =
m_Chunks.begin(); itr !=
m_Chunks.end(); ++itr)
67 if ((itr->m_ChunkX == a_ChunkX) && (itr->m_ChunkZ == a_ChunkZ))
112 if ((itr->m_ChunkX == a_ChunkX) && (itr->m_ChunkZ == a_ChunkZ))
void AddChunkStay(cChunkStay &a_ChunkStay)
Adds a new cChunkStay descendant to the internal list of ChunkStays; loads its chunks.
void DelChunkStay(cChunkStay &a_ChunkStay)
Removes the specified cChunkStay descendant from the internal list of ChunkStays.
virtual void Disable(void)
Disables the ChunkStay, the chunks are released and the ChunkStay object can be edited with Add() and...
void Clear(void)
Clears all the chunks that have been added.
virtual bool OnAllChunksAvailable(void)=0
Called once all of the contained chunks are available.
void Remove(int a_ChunkX, int a_ChunkZ)
Releases the chunk so that it's no longer locked from unloading.
void Add(int a_ChunkX, int a_ChunkZ)
Adds a chunk to be locked from unloading.
void Enable(cChunkMap &a_ChunkMap)
Enables the ChunkStay on the specified chunkmap, causing it to load and generate chunks.
bool ChunkAvailable(int a_ChunkX, int a_ChunkZ)
Called by cChunkMap when a chunk is available, checks m_NumLoaded and triggers the appropriate callba...
cChunkCoordsVector m_Chunks
The list of chunks to lock from unloading.
virtual void OnChunkAvailable(int a_ChunkX, int a_ChunkZ)=0
Called when a specific chunk become available.
cChunkMap * m_ChunkMap
The chunkmap where the object is enabled.
virtual ~cChunkStay()
Deletes the object.
cChunkCoordsVector m_OutstandingChunks
The chunks that still need loading.