Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
cIncrementalRedstoneSimulatorChunkData Class Referencefinal

#include <RedstoneSimulatorChunkData.h>

Inheritance diagram for cIncrementalRedstoneSimulatorChunkData:
Inheritance graph
[legend]
Collaboration diagram for cIncrementalRedstoneSimulatorChunkData:
Collaboration graph
[legend]

Public Member Functions

void ErasePowerData (const Vector3i Position)
 Erase all cached redstone data for position. More...
 
PowerLevel ExchangeUpdateOncePowerData (const Vector3i &a_Position, PowerLevel Power)
 
auto & GetActiveBlocks ()
 
PowerLevel GetCachedPowerData (const Vector3i Position) const
 
std::pair< int, bool > * GetMechanismDelayInfo (const Vector3i Position)
 
void SetCachedPowerData (const Vector3i Position, const PowerLevel PowerLevel)
 
void WakeUp (const Vector3i &a_Position)
 
- Public Member Functions inherited from cRedstoneSimulatorChunkData
virtual ~cRedstoneSimulatorChunkData ()
 

Static Public Member Functions

static Vector3i RebaseRelativePosition (const cChunk &From, const cChunk &To, const Vector3i Position)
 Adjust From-relative coordinates into To-relative coordinates. More...
 

Public Attributes

std::unordered_set< Vector3i, VectorHasher< int > > AlwaysTickedPositions
 
std::unordered_map< Vector3i, std::pair< int, bool >, VectorHasher< int > > m_MechanismDelays
 Structure storing position of mechanism + it's delay ticks (countdown) & if to power on. More...
 
std::unordered_map< Vector3i, std::pair< BLOCKTYPE, NIBBLETYPE >, VectorHasher< int > > ObserverCache
 Structure storing an observer's last seen block. More...
 
std::unordered_map< Vector3i, BlockState, VectorHasher< int > > WireStates
 Temporary, should be chunk data: wire block store, to avoid recomputing states every time. More...
 

Private Attributes

std::stack< Vector3i, std::vector< Vector3i > > m_ActiveBlocks
 
std::unordered_map< Vector3i, PowerLevel, VectorHasher< int > > m_CachedPowerLevels
 

Friends

class cRedstoneHandlerFactory
 

Detailed Description

Definition at line 20 of file RedstoneSimulatorChunkData.h.

Member Function Documentation

◆ ErasePowerData()

void cIncrementalRedstoneSimulatorChunkData::ErasePowerData ( const Vector3i  Position)
inline

Erase all cached redstone data for position.

Definition at line 52 of file RedstoneSimulatorChunkData.h.

◆ ExchangeUpdateOncePowerData()

PowerLevel cIncrementalRedstoneSimulatorChunkData::ExchangeUpdateOncePowerData ( const Vector3i a_Position,
PowerLevel  Power 
)
inline

Definition at line 61 of file RedstoneSimulatorChunkData.h.

◆ GetActiveBlocks()

auto& cIncrementalRedstoneSimulatorChunkData::GetActiveBlocks ( )
inline

Definition at line 29 of file RedstoneSimulatorChunkData.h.

◆ GetCachedPowerData()

PowerLevel cIncrementalRedstoneSimulatorChunkData::GetCachedPowerData ( const Vector3i  Position) const
inline

Definition at line 34 of file RedstoneSimulatorChunkData.h.

◆ GetMechanismDelayInfo()

std::pair<int, bool>* cIncrementalRedstoneSimulatorChunkData::GetMechanismDelayInfo ( const Vector3i  Position)
inline

Definition at line 45 of file RedstoneSimulatorChunkData.h.

◆ RebaseRelativePosition()

static Vector3i cIncrementalRedstoneSimulatorChunkData::RebaseRelativePosition ( const cChunk From,
const cChunk To,
const Vector3i  Position 
)
inlinestatic

Adjust From-relative coordinates into To-relative coordinates.

Definition at line 75 of file RedstoneSimulatorChunkData.h.

◆ SetCachedPowerData()

void cIncrementalRedstoneSimulatorChunkData::SetCachedPowerData ( const Vector3i  Position,
const PowerLevel  PowerLevel 
)
inline

Definition at line 40 of file RedstoneSimulatorChunkData.h.

◆ WakeUp()

void cIncrementalRedstoneSimulatorChunkData::WakeUp ( const Vector3i a_Position)
inline

Definition at line 24 of file RedstoneSimulatorChunkData.h.

Friends And Related Function Documentation

◆ cRedstoneHandlerFactory

friend class cRedstoneHandlerFactory
friend

Definition at line 104 of file RedstoneSimulatorChunkData.h.

Member Data Documentation

◆ AlwaysTickedPositions

std::unordered_set<Vector3i, VectorHasher<int> > cIncrementalRedstoneSimulatorChunkData::AlwaysTickedPositions

Definition at line 88 of file RedstoneSimulatorChunkData.h.

◆ m_ActiveBlocks

std::stack<Vector3i, std::vector<Vector3i> > cIncrementalRedstoneSimulatorChunkData::m_ActiveBlocks
private

Definition at line 98 of file RedstoneSimulatorChunkData.h.

◆ m_CachedPowerLevels

std::unordered_map<Vector3i, PowerLevel, VectorHasher<int> > cIncrementalRedstoneSimulatorChunkData::m_CachedPowerLevels
private

Definition at line 102 of file RedstoneSimulatorChunkData.h.

◆ m_MechanismDelays

std::unordered_map<Vector3i, std::pair<int, bool>, VectorHasher<int> > cIncrementalRedstoneSimulatorChunkData::m_MechanismDelays

Structure storing position of mechanism + it's delay ticks (countdown) & if to power on.

Definition at line 94 of file RedstoneSimulatorChunkData.h.

◆ ObserverCache

std::unordered_map<Vector3i, std::pair<BLOCKTYPE, NIBBLETYPE>, VectorHasher<int> > cIncrementalRedstoneSimulatorChunkData::ObserverCache

Structure storing an observer's last seen block.

Definition at line 91 of file RedstoneSimulatorChunkData.h.

◆ WireStates

std::unordered_map<Vector3i, BlockState, VectorHasher<int> > cIncrementalRedstoneSimulatorChunkData::WireStates

Temporary, should be chunk data: wire block store, to avoid recomputing states every time.

Definition at line 86 of file RedstoneSimulatorChunkData.h.


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