Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cWorld::cChunkGeneratorCallbacks Class Reference

Implementation of the callbacks that the ChunkGenerator uses to store new chunks and interface to plugins. More...

Inheritance diagram for cWorld::cChunkGeneratorCallbacks:
Inheritance graph
[legend]
Collaboration diagram for cWorld::cChunkGeneratorCallbacks:
Collaboration graph
[legend]

Public Member Functions

 cChunkGeneratorCallbacks (cWorld &a_World)
 
- Public Member Functions inherited from cChunkGeneratorThread::cChunkSink
virtual ~cChunkSink ()
 
- Public Member Functions inherited from cChunkGeneratorThread::cPluginInterface
virtual ~cPluginInterface ()
 

Private Member Functions

virtual void CallHookChunkGenerated (cChunkDesc &a_ChunkDesc) override
 Called after the chunk is generated, before it is handed to the chunk sink. More...
 
virtual void CallHookChunkGenerating (cChunkDesc &a_ChunkDesc) override
 Called when the chunk is about to be generated. More...
 
virtual bool HasChunkAnyClients (cChunkCoords a_Coords) override
 Called when the generator is overloaded to skip chunks that are no longer needed. More...
 
virtual bool IsChunkQueued (cChunkCoords a_Coords) override
 Called to check whether the specified chunk is in the queued state. More...
 
virtual bool IsChunkValid (cChunkCoords a_Coords) override
 Called just before the chunk generation is started, to verify that it hasn't been generated in the meantime. More...
 
virtual void OnChunkGenerated (cChunkDesc &a_ChunkDesc) override
 Called after the chunk has been generated The interface may store the chunk, send it over network, whatever. More...
 

Private Attributes

cWorldm_World
 

Detailed Description

Implementation of the callbacks that the ChunkGenerator uses to store new chunks and interface to plugins.

Definition at line 1105 of file World.h.

Constructor & Destructor Documentation

cWorld::cChunkGeneratorCallbacks::cChunkGeneratorCallbacks ( cWorld a_World)

Definition at line 3528 of file World.cpp.

Member Function Documentation

void cWorld::cChunkGeneratorCallbacks::CallHookChunkGenerated ( cChunkDesc a_ChunkDesc)
overrideprivatevirtual

Called after the chunk is generated, before it is handed to the chunk sink.

a_ChunkDesc contains the generated chunk data. Implementation may modify this data.

Implements cChunkGeneratorThread::cPluginInterface.

Definition at line 3596 of file World.cpp.

void cWorld::cChunkGeneratorCallbacks::CallHookChunkGenerating ( cChunkDesc a_ChunkDesc)
overrideprivatevirtual

Called when the chunk is about to be generated.

The generator may be partly or fully overriden by the implementation.

Implements cChunkGeneratorThread::cPluginInterface.

Definition at line 3585 of file World.cpp.

bool cWorld::cChunkGeneratorCallbacks::HasChunkAnyClients ( cChunkCoords  a_Coords)
overrideprivatevirtual

Called when the generator is overloaded to skip chunks that are no longer needed.

If this callback returns false, the chunk is not generated.

Implements cChunkGeneratorThread::cChunkSink.

Definition at line 3576 of file World.cpp.

bool cWorld::cChunkGeneratorCallbacks::IsChunkQueued ( cChunkCoords  a_Coords)
overrideprivatevirtual

Called to check whether the specified chunk is in the queued state.

Currently used only in Debug-mode asserts.

Implements cChunkGeneratorThread::cChunkSink.

Definition at line 3567 of file World.cpp.

bool cWorld::cChunkGeneratorCallbacks::IsChunkValid ( cChunkCoords  a_Coords)
overrideprivatevirtual

Called just before the chunk generation is started, to verify that it hasn't been generated in the meantime.

If this callback returns true, the chunk is not generated.

Implements cChunkGeneratorThread::cChunkSink.

Definition at line 3558 of file World.cpp.

void cWorld::cChunkGeneratorCallbacks::OnChunkGenerated ( cChunkDesc a_ChunkDesc)
overrideprivatevirtual

Called after the chunk has been generated The interface may store the chunk, send it over network, whatever.

The chunk is not expected to be modified, but the generator will survive if the implementation changes the data within. All changes are ignored, though.

Implements cChunkGeneratorThread::cChunkSink.

Definition at line 3537 of file World.cpp.

Member Data Documentation

cWorld* cWorld::cChunkGeneratorCallbacks::m_World
private

Definition at line 1109 of file World.h.


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