![]() |
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <IncrementalRedstoneSimulator.h>
Private Types | |
using | Super = cRedstoneSimulator |
Private Member Functions | |
virtual void | AddBlock (cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override |
Called to simulate a new block. More... | |
virtual cRedstoneSimulatorChunkData * | CreateChunkData () override |
void | ProcessWorkItem (cChunk &Chunk, cChunk &TickingSource, const Vector3i Position) |
virtual void | SimulateChunk (std::chrono::milliseconds Dt, int ChunkX, int ChunkZ, cChunk *Chunk) override |
virtual void | WakeUp (cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) override |
Called to simulate a single new block, typically as a result of a single block break or change. More... | |
virtual void | WakeUp (cChunk &a_Chunk, Vector3i a_Position, Vector3i a_Offset, BLOCKTYPE a_Block) override |
Called to simulate a single block, synthesised by the simulator manager. More... | |
Static Private Member Functions | |
static bool | IsAlwaysTicked (BLOCKTYPE a_Block) |
Returns if a redstone device is always ticked due to influence by its environment. More... | |
static bool | IsRedstone (BLOCKTYPE a_Block) |
Returns if a block is any sort of redstone device. More... | |
Additional Inherited Members | |
![]() | |
cSimulator (cWorld &a_World) | |
virtual | ~cSimulator () |
![]() | |
static std::array< Vector3i, 5 > | GetLinkedOffsets (Vector3i Offset) |
For a given offset from a position, return the offsets that represent the adjacents of the newly offset position, excluding the old position. More... | |
![]() | |
static constexpr std::array< Vector3i, 6 > | AdjacentOffsets |
Contains offsets for direct adjacents of any position. More... | |
![]() | |
virtual void | Simulate (float a_Dt) |
![]() | |
cWorld & | m_World |
Definition at line 10 of file IncrementalRedstoneSimulator.h.
|
private |
Definition at line 13 of file IncrementalRedstoneSimulator.h.
|
overrideprivatevirtual |
Called to simulate a new block.
Unlike WakeUp this function will perform minimal checking. It queues the block to be simulated as fast as possible, suitable for area wakeups.
Implements cSimulator.
Definition at line 155 of file IncrementalRedstoneSimulator.cpp.
|
overrideprivatevirtual |
Implements cRedstoneSimulator.
Definition at line 184 of file IncrementalRedstoneSimulator.cpp.
|
staticprivate |
Returns if a redstone device is always ticked due to influence by its environment.
Definition at line 14 of file IncrementalRedstoneSimulator.cpp.
|
staticprivate |
Returns if a block is any sort of redstone device.
Definition at line 33 of file IncrementalRedstoneSimulator.cpp.
|
private |
Definition at line 98 of file IncrementalRedstoneSimulator.cpp.
|
overrideprivatevirtual |
Implements cSimulator.
Definition at line 115 of file IncrementalRedstoneSimulator.cpp.
|
overrideprivatevirtual |
Called to simulate a single new block, typically as a result of a single block break or change.
The simulator implementation may decide to perform additional checks or maintain consistency of internal state before the block is added to the simulate queue.
Reimplemented from cSimulator.
Definition at line 193 of file IncrementalRedstoneSimulator.cpp.
|
overrideprivatevirtual |
Called to simulate a single block, synthesised by the simulator manager.
The position represents the adjacents of the block that was actually changed, with the offset used given. Simulators may use this information to update additional blocks that were affected by the change, or queue farther, extra-adjacents blocks to be updated. The simulator manager calls this overload after the 3-argument WakeUp.
Reimplemented from cSimulator.
Definition at line 207 of file IncrementalRedstoneSimulator.cpp.