Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <SimulatorManager.h>
Public Member Functions | |
cSimulatorManager (cWorld &a_World) | |
void | RegisterSimulator (cSimulator *a_Simulator, int a_Rate) |
void | Simulate (float a_Dt) |
Called in each tick, a_Dt is the time passed since the last tick, in msec. More... | |
void | SimulateChunk (std::chrono::milliseconds a_DT, int a_ChunkX, int a_ChunkZ, cChunk *a_Chunk) |
Called in each tick for each chunk, a_Dt is the time passed since the last tick, in msec; direct access to chunk data available. More... | |
void | WakeUp (cChunk &a_Chunk, Vector3i a_Position) |
void | WakeUp (const cCuboid &a_Area) |
Does the same processing as WakeUp, but for all blocks within the specified area. More... | |
~cSimulatorManager () | |
Protected Types | |
typedef std::vector< std::pair< cSimulator *, int > > | cSimulators |
Protected Attributes | |
cSimulators | m_Simulators |
long long | m_Ticks |
cWorld & | m_World |
Definition at line 28 of file SimulatorManager.h.
|
protected |
Definition at line 55 of file SimulatorManager.h.
cSimulatorManager::cSimulatorManager | ( | cWorld & | a_World | ) |
Definition at line 13 of file SimulatorManager.cpp.
cSimulatorManager::~cSimulatorManager | ( | ) |
Definition at line 23 of file SimulatorManager.cpp.
void cSimulatorManager::RegisterSimulator | ( | cSimulator * | a_Simulator, |
int | a_Rate | ||
) |
Definition at line 153 of file SimulatorManager.cpp.
void cSimulatorManager::Simulate | ( | float | a_Dt | ) |
Called in each tick, a_Dt is the time passed since the last tick, in msec.
Definition at line 31 of file SimulatorManager.cpp.
void cSimulatorManager::SimulateChunk | ( | std::chrono::milliseconds | a_DT, |
int | a_ChunkX, | ||
int | a_ChunkZ, | ||
cChunk * | a_Chunk | ||
) |
Called in each tick for each chunk, a_Dt is the time passed since the last tick, in msec; direct access to chunk data available.
Definition at line 48 of file SimulatorManager.cpp.
Definition at line 65 of file SimulatorManager.cpp.
void cSimulatorManager::WakeUp | ( | const cCuboid & | a_Area | ) |
Does the same processing as WakeUp, but for all blocks within the specified area.
Has better performance than calling WakeUp for each block individually, due to neighbor-checking. All chunks intersected by the area should be valid (outputs a warning if not). Note that, unlike WakeUp(), this call adds blocks not only face-neighboring, but also edge-neighboring and corner-neighboring the specified area.
Definition at line 105 of file SimulatorManager.cpp.
|
protected |
Definition at line 58 of file SimulatorManager.h.
|
protected |
Definition at line 59 of file SimulatorManager.h.
|
protected |
Definition at line 57 of file SimulatorManager.h.