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) |
void | SimulateChunk (std::chrono::milliseconds a_DT, int a_ChunkX, int a_ChunkZ, cChunk *a_Chunk) |
void | WakeUp (Vector3i a_Block, cChunk *a_Chunk) |
void | WakeUpArea (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 51 of file SimulatorManager.h.
cSimulatorManager::cSimulatorManager | ( | cWorld & | a_World | ) |
Definition at line 11 of file SimulatorManager.cpp.
cSimulatorManager::~cSimulatorManager | ( | ) |
Definition at line 21 of file SimulatorManager.cpp.
void cSimulatorManager::RegisterSimulator | ( | cSimulator * | a_Simulator, |
int | a_Rate | ||
) |
Definition at line 85 of file SimulatorManager.cpp.
void cSimulatorManager::Simulate | ( | float | a_Dt | ) |
Definition at line 29 of file SimulatorManager.cpp.
void cSimulatorManager::SimulateChunk | ( | std::chrono::milliseconds | a_DT, |
int | a_ChunkX, | ||
int | a_ChunkZ, | ||
cChunk * | a_Chunk | ||
) |
Definition at line 45 of file SimulatorManager.cpp.
Definition at line 61 of file SimulatorManager.cpp.
void cSimulatorManager::WakeUpArea | ( | 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. So far none of the simulators care about that.
Definition at line 73 of file SimulatorManager.cpp.
|
protected |
Definition at line 54 of file SimulatorManager.h.
|
protected |
Definition at line 55 of file SimulatorManager.h.
|
protected |
Definition at line 53 of file SimulatorManager.h.