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

#include <SimulatorManager.h>

Collaboration diagram for cSimulatorManager:
Collaboration graph
[legend]

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
 
cWorldm_World
 

Detailed Description

Definition at line 28 of file SimulatorManager.h.

Member Typedef Documentation

typedef std::vector<std::pair<cSimulator *, int> > cSimulatorManager::cSimulators
protected

Definition at line 51 of file SimulatorManager.h.

Constructor & Destructor Documentation

cSimulatorManager::cSimulatorManager ( cWorld a_World)

Definition at line 11 of file SimulatorManager.cpp.

cSimulatorManager::~cSimulatorManager ( )

Definition at line 21 of file SimulatorManager.cpp.

Member Function Documentation

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.

void cSimulatorManager::WakeUp ( Vector3i  a_Block,
cChunk a_Chunk 
)

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.

Member Data Documentation

cSimulators cSimulatorManager::m_Simulators
protected

Definition at line 54 of file SimulatorManager.h.

long long cSimulatorManager::m_Ticks
protected

Definition at line 55 of file SimulatorManager.h.

cWorld& cSimulatorManager::m_World
protected

Definition at line 53 of file SimulatorManager.h.


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