载入中...
搜索中...
未找到
eve::pixelworld::PixelWorld::Impl结构体 参考

Public 成员函数

 Impl (MaterialCatalog ownedCatalog=MaterialCatalog::builtIn())
 
const Chunk * findChunk (int x, int y) const noexcept
 
Chunk * findChunk (int x, int y) noexcept
 
Chunk & ensureChunk (int x, int y)
 
bool isMobile (MaterialId material) const noexcept
 
MaterialState materialState (MaterialId material) const noexcept
 
void rebuildMaterialRuntimeTables ()
 
bool canDisplace (MaterialId source, MaterialId target) const noexcept
 
std::span< const std::uint16_t > reactionRules (MaterialId source, MaterialId target) const noexcept
 
std::uint8_t thermalConductivity (MaterialId material) const noexcept
 
std::uint16_t heatCapacity (MaterialId material) const noexcept
 
void addActivity (Chunk &chunk, const PixelCell &cell) const noexcept
 
void removeActivity (Chunk &chunk, const PixelCell &cell) const noexcept
 
void rebuildActivity (Chunk &chunk) const noexcept
 
void refreshTemperatureBounds (Chunk &chunk) const noexcept
 
PixelCell get (int x, int y) const noexcept
 
PixelCell normalizeCell (PixelCell cell) const noexcept
 
std::uint64_t updatedAt (int x, int y) const noexcept
 
void wakeAround (int x, int y)
 
void put (int x, int y, PixelCell cell, std::uint64_t updatedTick, bool markUpdated=true)
 
void putNormalizedWithinChunk (Chunk &chunk, std::size_t index, const PixelCell &cell, std::uint64_t updatedTick, bool markUpdated=true)
 
void putWithinChunk (Chunk &chunk, std::size_t index, PixelCell cell, std::uint64_t updatedTick, bool markUpdated=true)
 
bool moveOrSwap (int x, int y, int tx, int ty, std::uint64_t currentTick)
 
bool moveOrSwapKnownSource (int x, int y, PixelCell source, int tx, int ty, std::uint64_t currentTick)
 
bool moveOrSwapWithinChunk (ChunkCoord coord, Chunk &chunk, int sourceX, int sourceY, PixelCell source, int targetX, int targetY, std::uint64_t currentTick)
 
bool pseudoBit (int x, int y, std::uint64_t currentTick) const noexcept
 

Public 属性

std::unordered_map< ChunkCoord, Chunk, ChunkCoordHash > chunks
 
std::unordered_map< ChunkCoord, std::uint64_t, ChunkCoordHash > removedChunks
 
MaterialCatalog catalog
 
std::vector< std::uint8_t > canDisplaceTable
 
std::vector< MaterialState > materialStates
 
std::vector< std::uint8_t > thermalConductivities
 
std::vector< std::uint16_t > heatCapacities
 
std::vector< std::vector< std::uint16_t > > reactionRulesByPair
 
std::size_t materialRuntimeCount = 0
 
std::uint64_t seed = 1
 
std::uint64_t revision = 0
 
std::uint64_t tick = 0
 
std::uint64_t lastEditSequence = 0
 
std::uint64_t worldId = nextPixelWorldId.fetch_add(1, std::memory_order_relaxed)
 
std::uint64_t epoch = 1
 
std::uint64_t nextFragmentId = 1
 
bool paused = false
 

详细描述

在文件 PixelWorld.cpp 第 93 行定义.

构造及析构函数说明

◆ Impl()

eve::pixelworld::PixelWorld::Impl::Impl ( MaterialCatalog  ownedCatalog = MaterialCatalog::builtIn())
inlineexplicit

在文件 PixelWorld.cpp 第 94 行定义.

引用了 rebuildMaterialRuntimeTables().

成员函数说明

◆ addActivity()

void eve::pixelworld::PixelWorld::Impl::addActivity ( Chunk &  chunk,
const PixelCell &  cell 
) const
inlinenoexcept

在文件 PixelWorld.cpp 第 203 行定义.

引用了 eve::pixelworld::Air, cell, isMobile() , 以及 material.

被这些函数引用 put(), putNormalizedWithinChunk() , 以及 rebuildActivity().

◆ canDisplace()

bool eve::pixelworld::PixelWorld::Impl::canDisplace ( MaterialId  source,
MaterialId  target 
) const
inlinenoexcept

在文件 PixelWorld.cpp 第 178 行定义.

引用了 canDisplaceTable, materialRuntimeCount, source , 以及 target.

被这些函数引用 moveOrSwapKnownSource() , 以及 moveOrSwapWithinChunk().

◆ ensureChunk()

Chunk & eve::pixelworld::PixelWorld::Impl::ensureChunk ( int  x,
int  y 
)
inline

在文件 PixelWorld.cpp 第 127 行定义.

引用了 chunks, x , 以及 y.

被这些函数引用 put().

◆ findChunk() [1/2]

const Chunk * eve::pixelworld::PixelWorld::Impl::findChunk ( int  x,
int  y 
) const
inlinenoexcept

在文件 PixelWorld.cpp 第 117 行定义.

引用了 chunks, found, x , 以及 y.

被这些函数引用 get() , 以及 updatedAt().

◆ findChunk() [2/2]

Chunk * eve::pixelworld::PixelWorld::Impl::findChunk ( int  x,
int  y 
)
inlinenoexcept

在文件 PixelWorld.cpp 第 122 行定义.

引用了 chunks, found, x , 以及 y.

◆ get()

PixelCell eve::pixelworld::PixelWorld::Impl::get ( int  x,
int  y 
) const
inlinenoexcept

在文件 PixelWorld.cpp 第 255 行定义.

引用了 findChunk(), x , 以及 y.

被这些函数引用 moveOrSwap() , 以及 moveOrSwapKnownSource().

◆ heatCapacity()

std::uint16_t eve::pixelworld::PixelWorld::Impl::heatCapacity ( MaterialId  material) const
inlinenoexcept

在文件 PixelWorld.cpp 第 198 行定义.

引用了 heatCapacities, index , 以及 material.

◆ isMobile()

bool eve::pixelworld::PixelWorld::Impl::isMobile ( MaterialId  material) const
inlinenoexcept

◆ materialState()

MaterialState eve::pixelworld::PixelWorld::Impl::materialState ( MaterialId  material) const
inlinenoexcept

在文件 PixelWorld.cpp 第 136 行定义.

引用了 eve::pixelworld::Empty, index, material , 以及 materialStates.

◆ moveOrSwap()

bool eve::pixelworld::PixelWorld::Impl::moveOrSwap ( int  x,
int  y,
int  tx,
int  ty,
std::uint64_t  currentTick 
)
inline

在文件 PixelWorld.cpp 第 335 行定义.

引用了 get(), moveOrSwapKnownSource(), source, x , 以及 y.

◆ moveOrSwapKnownSource()

bool eve::pixelworld::PixelWorld::Impl::moveOrSwapKnownSource ( int  x,
int  y,
PixelCell  source,
int  tx,
int  ty,
std::uint64_t  currentTick 
)
inline

在文件 PixelWorld.cpp 第 340 行定义.

引用了 canDisplace(), get(), put(), source, target, wakeAround(), x , 以及 y.

被这些函数引用 moveOrSwap().

◆ moveOrSwapWithinChunk()

bool eve::pixelworld::PixelWorld::Impl::moveOrSwapWithinChunk ( ChunkCoord  coord,
Chunk &  chunk,
int  sourceX,
int  sourceY,
PixelCell  source,
int  targetX,
int  targetY,
std::uint64_t  currentTick 
)
inline

◆ normalizeCell()

PixelCell eve::pixelworld::PixelWorld::Impl::normalizeCell ( PixelCell  cell) const
inlinenoexcept

◆ pseudoBit()

bool eve::pixelworld::PixelWorld::Impl::pseudoBit ( int  x,
int  y,
std::uint64_t  currentTick 
) const
inlinenoexcept

在文件 PixelWorld.cpp 第 374 行定义.

引用了 seed, value, x , 以及 y.

◆ put()

void eve::pixelworld::PixelWorld::Impl::put ( int  x,
int  y,
PixelCell  cell,
std::uint64_t  updatedTick,
bool  markUpdated = true 
)
inline

在文件 PixelWorld.cpp 第 299 行定义.

引用了 addActivity(), cell, ensureChunk(), index, normalizeCell(), removeActivity(), removedChunks, revision, x , 以及 y.

被这些函数引用 moveOrSwapKnownSource().

◆ putNormalizedWithinChunk()

void eve::pixelworld::PixelWorld::Impl::putNormalizedWithinChunk ( Chunk &  chunk,
std::size_t  index,
const PixelCell &  cell,
std::uint64_t  updatedTick,
bool  markUpdated = true 
)
inline

在文件 PixelWorld.cpp 第 316 行定义.

引用了 addActivity(), cell, index, removeActivity() , 以及 revision.

被这些函数引用 putWithinChunk().

◆ putWithinChunk()

void eve::pixelworld::PixelWorld::Impl::putWithinChunk ( Chunk &  chunk,
std::size_t  index,
PixelCell  cell,
std::uint64_t  updatedTick,
bool  markUpdated = true 
)
inline

在文件 PixelWorld.cpp 第 330 行定义.

引用了 cell, index, normalizeCell() , 以及 putNormalizedWithinChunk().

◆ reactionRules()

std::span< const std::uint16_t > eve::pixelworld::PixelWorld::Impl::reactionRules ( MaterialId  source,
MaterialId  target 
) const
inlinenoexcept

在文件 PixelWorld.cpp 第 185 行定义.

引用了 materialRuntimeCount, reactionRulesByPair, source , 以及 target.

◆ rebuildActivity()

void eve::pixelworld::PixelWorld::Impl::rebuildActivity ( Chunk &  chunk) const
inlinenoexcept

在文件 PixelWorld.cpp 第 231 行定义.

引用了 addActivity() , 以及 cell.

被这些函数引用 eve::pixelworld::PixelWorld::applyChunkBatch() , 以及 eve::pixelworld::PixelWorld::restoreSnapshot().

◆ rebuildMaterialRuntimeTables()

◆ refreshTemperatureBounds()

void eve::pixelworld::PixelWorld::Impl::refreshTemperatureBounds ( Chunk &  chunk) const
inlinenoexcept

在文件 PixelWorld.cpp 第 243 行定义.

引用了 eve::pixelworld::Air , 以及 cell.

◆ removeActivity()

void eve::pixelworld::PixelWorld::Impl::removeActivity ( Chunk &  chunk,
const PixelCell &  cell 
) const
inlinenoexcept

在文件 PixelWorld.cpp 第 217 行定义.

引用了 eve::pixelworld::Air, cell, isMobile() , 以及 material.

被这些函数引用 put() , 以及 putNormalizedWithinChunk().

◆ thermalConductivity()

std::uint8_t eve::pixelworld::PixelWorld::Impl::thermalConductivity ( MaterialId  material) const
inlinenoexcept

在文件 PixelWorld.cpp 第 193 行定义.

引用了 index, material , 以及 thermalConductivities.

◆ updatedAt()

std::uint64_t eve::pixelworld::PixelWorld::Impl::updatedAt ( int  x,
int  y 
) const
inlinenoexcept

在文件 PixelWorld.cpp 第 285 行定义.

引用了 findChunk(), x , 以及 y.

◆ wakeAround()

void eve::pixelworld::PixelWorld::Impl::wakeAround ( int  x,
int  y 
)
inline

在文件 PixelWorld.cpp 第 290 行定义.

引用了 chunks, cx, cy, found, ox, oy, x , 以及 y.

被这些函数引用 moveOrSwapKnownSource() , 以及 moveOrSwapWithinChunk().

类成员变量说明

◆ canDisplaceTable

std::vector<std::uint8_t> eve::pixelworld::PixelWorld::Impl::canDisplaceTable

在文件 PixelWorld.cpp 第 102 行定义.

被这些函数引用 canDisplace() , 以及 rebuildMaterialRuntimeTables().

◆ catalog

MaterialCatalog eve::pixelworld::PixelWorld::Impl::catalog

◆ chunks

std::unordered_map<ChunkCoord, Chunk, ChunkCoordHash> eve::pixelworld::PixelWorld::Impl::chunks

◆ epoch

std::uint64_t eve::pixelworld::PixelWorld::Impl::epoch = 1

◆ heatCapacities

std::vector<std::uint16_t> eve::pixelworld::PixelWorld::Impl::heatCapacities

在文件 PixelWorld.cpp 第 105 行定义.

被这些函数引用 heatCapacity() , 以及 rebuildMaterialRuntimeTables().

◆ lastEditSequence

std::uint64_t eve::pixelworld::PixelWorld::Impl::lastEditSequence = 0

◆ materialRuntimeCount

std::size_t eve::pixelworld::PixelWorld::Impl::materialRuntimeCount = 0

在文件 PixelWorld.cpp 第 107 行定义.

被这些函数引用 canDisplace(), reactionRules() , 以及 rebuildMaterialRuntimeTables().

◆ materialStates

std::vector<MaterialState> eve::pixelworld::PixelWorld::Impl::materialStates

在文件 PixelWorld.cpp 第 103 行定义.

被这些函数引用 isMobile(), materialState() , 以及 rebuildMaterialRuntimeTables().

◆ nextFragmentId

std::uint64_t eve::pixelworld::PixelWorld::Impl::nextFragmentId = 1

◆ paused

bool eve::pixelworld::PixelWorld::Impl::paused = false

◆ reactionRulesByPair

std::vector<std::vector<std::uint16_t> > eve::pixelworld::PixelWorld::Impl::reactionRulesByPair

在文件 PixelWorld.cpp 第 106 行定义.

被这些函数引用 reactionRules() , 以及 rebuildMaterialRuntimeTables().

◆ removedChunks

std::unordered_map<ChunkCoord, std::uint64_t, ChunkCoordHash> eve::pixelworld::PixelWorld::Impl::removedChunks

在文件 PixelWorld.cpp 第 100 行定义.

被这些函数引用 eve::pixelworld::PixelWorld::applyChunkBatch() , 以及 put().

◆ revision

std::uint64_t eve::pixelworld::PixelWorld::Impl::revision = 0

◆ seed

std::uint64_t eve::pixelworld::PixelWorld::Impl::seed = 1

在文件 PixelWorld.cpp 第 108 行定义.

被这些函数引用 pseudoBit() , 以及 eve::pixelworld::PixelWorld::restoreSnapshot().

◆ thermalConductivities

std::vector<std::uint8_t> eve::pixelworld::PixelWorld::Impl::thermalConductivities

在文件 PixelWorld.cpp 第 104 行定义.

被这些函数引用 rebuildMaterialRuntimeTables() , 以及 thermalConductivity().

◆ tick

std::uint64_t eve::pixelworld::PixelWorld::Impl::tick = 0

◆ worldId

std::uint64_t eve::pixelworld::PixelWorld::Impl::worldId = nextPixelWorldId.fetch_add(1, std::memory_order_relaxed)

该结构体的文档由以下文件生成: