Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
cLightingThread::cLightingChunkStay Class Reference

#include <LightingThread.h>

Inheritance diagram for cLightingThread::cLightingChunkStay:
Inheritance graph
[legend]
Collaboration diagram for cLightingThread::cLightingChunkStay:
Collaboration graph
[legend]

Public Member Functions

 cLightingChunkStay (cLightingThread &a_LightingThread, int a_ChunkX, int a_ChunkZ, std::unique_ptr< cChunkCoordCallback > a_CallbackAfter)
 
- Public Member Functions inherited from cChunkStay
void Add (int a_ChunkX, int a_ChunkZ)
 Adds a chunk to be locked from unloading. More...
 
 cChunkStay (void)
 
void Clear (void)
 Clears all the chunks that have been added. More...
 
virtual void Disable (void)
 Disables the ChunkStay, the chunks are released and the ChunkStay object can be edited with Add() and Remove() again. More...
 
void Enable (cChunkMap &a_ChunkMap)
 Enables the ChunkStay on the specified chunkmap, causing it to load and generate chunks. More...
 
const cChunkCoordsVectorGetChunks (void) const
 Returns all the chunks that should be kept. More...
 
void Remove (int a_ChunkX, int a_ChunkZ)
 Releases the chunk so that it's no longer locked from unloading. More...
 
virtual ~cChunkStay ()
 Deletes the object. More...
 

Public Attributes

std::unique_ptr< cChunkCoordCallbackm_CallbackAfter
 
int m_ChunkX
 
int m_ChunkZ
 
cLightingThreadm_LightingThread
 

Protected Member Functions

virtual bool OnAllChunksAvailable (void) override
 Called once all of the contained chunks are available. More...
 
virtual void OnChunkAvailable (int a_ChunkX, int a_ChunkZ) override
 Called when a specific chunk become available. More...
 
virtual void OnDisabled (void) override
 Called by the ChunkMap when the ChunkStay is disabled. More...
 
- Protected Member Functions inherited from cChunkStay
bool ChunkAvailable (int a_ChunkX, int a_ChunkZ)
 Called by cChunkMap when a chunk is available, checks m_NumLoaded and triggers the appropriate callbacks. More...
 

Additional Inherited Members

- Protected Attributes inherited from cChunkStay
cChunkMapm_ChunkMap
 The chunkmap where the object is enabled. More...
 
cChunkCoordsVector m_Chunks
 The list of chunks to lock from unloading. More...
 
cChunkCoordsVector m_OutstandingChunks
 The chunks that still need loading. More...
 

Detailed Description

Definition at line 71 of file LightingThread.h.

Constructor & Destructor Documentation

◆ cLightingChunkStay()

cLightingThread::cLightingChunkStay::cLightingChunkStay ( cLightingThread a_LightingThread,
int  a_ChunkX,
int  a_ChunkZ,
std::unique_ptr< cChunkCoordCallback a_CallbackAfter 
)

Definition at line 590 of file LightingThread.cpp.

Member Function Documentation

◆ OnAllChunksAvailable()

bool cLightingThread::cLightingChunkStay::OnAllChunksAvailable ( void  )
overrideprotectedvirtual

Called once all of the contained chunks are available.

If returns true, the ChunkStay is automatically disabled by the ChunkMap; if it returns false, the ChunkStay is kept.

Implements cChunkStay.

Definition at line 611 of file LightingThread.cpp.

◆ OnChunkAvailable()

virtual void cLightingThread::cLightingChunkStay::OnChunkAvailable ( int  a_ChunkX,
int  a_ChunkZ 
)
inlineoverrideprotectedvirtual

Called when a specific chunk become available.

Implements cChunkStay.

Definition at line 83 of file LightingThread.h.

◆ OnDisabled()

void cLightingThread::cLightingChunkStay::OnDisabled ( void  )
overrideprotectedvirtual

Called by the ChunkMap when the ChunkStay is disabled.

The object may choose to delete itself.

Implements cChunkStay.

Definition at line 623 of file LightingThread.cpp.

Member Data Documentation

◆ m_CallbackAfter

std::unique_ptr<cChunkCoordCallback> cLightingThread::cLightingChunkStay::m_CallbackAfter

Definition at line 78 of file LightingThread.h.

◆ m_ChunkX

int cLightingThread::cLightingChunkStay::m_ChunkX

Definition at line 76 of file LightingThread.h.

◆ m_ChunkZ

int cLightingThread::cLightingChunkStay::m_ChunkZ

Definition at line 77 of file LightingThread.h.

◆ m_LightingThread

cLightingThread& cLightingThread::cLightingChunkStay::m_LightingThread

Definition at line 75 of file LightingThread.h.


The documentation for this class was generated from the following files: