ludus::content::procedural¶
Ludus Wiki · API overview · Browse API
Namespace
Related declarations¶
- ludus::content::procedural::ScatterIdentity
- ludus::content::procedural::ScatterRectangle
- ludus::content::procedural::ScatterCellRange
- ludus::content::procedural::ScatterVariant
- ludus::content::procedural::ScatterLayer
- ludus::content::procedural::ScatterRecipe
- ludus::content::procedural::ScatterDomains
- ludus::content::procedural::ScatterKeys
- ludus::content::procedural::ScatterPlacement
- ludus::content::procedural::ScatterValidation
Enumerations¶
ScatterStatus¶
enum class ScatterStatus : uint8
Related types: uint8
Success¶
Success
InvalidRecipe¶
InvalidRecipe
InvalidRange¶
InvalidRange
CapacityExceeded¶
CapacityExceeded
SamplingExhausted¶
SamplingExhausted
ScatterRecipeIssue¶
enum class ScatterRecipeIssue : uint8
Related types: uint8
None¶
None
RoomZero¶
RoomZero
EmptyRegion¶
EmptyRegion
KeepOutCount¶
KeepOutCount
EmptyKeepOut¶
EmptyKeepOut
LayerCount¶
LayerCount
DuplicateLayer¶
DuplicateLayer
CellSize¶
CellSize
CellRange¶
CellRange
CandidateCount¶
CandidateCount
VariantCount¶
VariantCount
ExclusionRadius¶
ExclusionRadius
ScaleRange¶
ScaleRange
Domain¶
Domain
Constants and variables¶
SCATTER_LAYOUT_VERSION¶
constexpr uint32 ludus::content::procedural::SCATTER_LAYOUT_VERSION = 1
Related types: uint32
MAX_SCATTER_LAYERS¶
constexpr usize ludus::content::procedural::MAX_SCATTER_LAYERS = 16
Related types: usize
MAX_SCATTER_KEEP_OUTS¶
constexpr usize ludus::content::procedural::MAX_SCATTER_KEEP_OUTS = 64
Related types: usize
MAX_SCATTER_VARIANTS¶
constexpr usize ludus::content::procedural::MAX_SCATTER_VARIANTS = 64
Related types: usize
MAX_SCATTER_CANDIDATES_PER_CELL¶
constexpr uint16 ludus::content::procedural::MAX_SCATTER_CANDIDATES_PER_CELL = 64
Related types: uint16
SCATTER_NEIGHBOR_CELLS¶
constexpr int32 ludus::content::procedural::SCATTER_NEIGHBOR_CELLS = 2
Related types: int32
SCATTER_SCOPE_ROOM_SHIFT¶
constexpr uint32 ludus::content::procedural::SCATTER_SCOPE_ROOM_SHIFT = 48U
Related types: uint32
SCATTER_SCOPE_LAYER_SHIFT¶
constexpr uint32 ludus::content::procedural::SCATTER_SCOPE_LAYER_SHIFT = 40U
Related types: uint32
SCATTER_SCOPE_CANDIDATE_SHIFT¶
constexpr uint32 ludus::content::procedural::SCATTER_SCOPE_CANDIDATE_SHIFT = 32U
Related types: uint32
SCATTER_SCOPE_CELL_X_SHIFT¶
constexpr uint32 ludus::content::procedural::SCATTER_SCOPE_CELL_X_SHIFT = 16U
Related types: uint32
DEFAULT_SCATTER_SCALE¶
constexpr uint16 ludus::content::procedural::DEFAULT_SCATTER_SCALE = 1000
Related types: uint16
Functions¶
PackScatterScope¶
constexpr uint64 ludus::content::procedural::PackScatterScope(ScatterIdentity identity) noexcept
Related types: uint64 · ScatterIdentity
UnpackScatterScope¶
constexpr ScatterIdentity ludus::content::procedural::UnpackScatterScope(uint64 scope) noexcept
Related types: uint64 · ScatterIdentity
ValidateScatterRecipe¶
ScatterValidation ludus::content::procedural::ValidateScatterRecipe(const ScatterRecipe &recipe) noexcept
Related types: ScatterRecipe · ScatterValidation
TryMakeScatterKeys¶
ScatterStatus ludus::content::procedural::TryMakeScatterKeys(uint64 worldSeed, ScatterDomains domains, ScatterKeys &outKeys) noexcept
| Parameter | Description |
|---|---|
worldSeed |
The session's recorded root seed; zero is a valid deterministic seed.
|
domains |
Distinct IDs in the game domain range.
|
outKeys |
Written on success; unchanged on failure.
|
Returns
Related types: ScatterStatus · uint64 · ScatterDomains · ScatterKeys
TryGetScatterCells¶
ScatterStatus ludus::content::procedural::TryGetScatterCells(const ScatterRecipe &recipe, usize layerIndex, ScatterCellRange &outCells) noexcept
| Parameter | Description |
|---|---|
recipe |
The room's recipe; validated by this call.
|
layerIndex |
Index into recipe.Layers.
|
outCells |
Written on success; unchanged on failure.
|
Returns
Related types: ScatterStatus · usize · ScatterCellRange · ScatterRecipe
TryCountScatterCandidates¶
ScatterStatus ludus::content::procedural::TryCountScatterCandidates(const ScatterRecipe &recipe, usize layerIndex, ScatterCellRange cells, usize &outCount) noexcept
| Parameter | Description |
|---|---|
recipe |
The room's recipe; validated by this call.
|
layerIndex |
Index into recipe.Layers.
|
cells |
A nonempty range inside TryGetScatterCells.
|
outCount |
Written on success; unchanged on failure.
|
Returns
Related types: ScatterStatus · usize · ScatterCellRange · ScatterRecipe
TryGenerateScatter¶
ScatterStatus ludus::content::procedural::TryGenerateScatter(const ScatterRecipe &recipe, const ScatterKeys &keys, usize layerIndex, ScatterCellRange cells, foundation::BorrowedView< ScatterPlacement > storage, usize &outCount) noexcept
| Parameter | Description |
|---|---|
recipe |
A recipe that passes ValidateScatterRecipe.
|
keys |
Keys from TryMakeScatterKeys.
|
layerIndex |
Index into recipe.Layers.
|
cells |
A nonempty range inside TryGetScatterCells.
|
storage |
Receives the placements; must hold TryCountScatterCandidates elements.
|
outCount |
Number of placements written, on success; unchanged on failure.
|
Returns
Related types: foundation::BorrowedView · ScatterStatus · usize · ScatterCellRange · ScatterKeys · ScatterPlacement · ScatterRecipe
Aliases¶
int16¶
using ludus::foundation::core::int16 = std::int16_t
int32¶
using ludus::foundation::core::int32 = std::int32_t
uint16¶
using ludus::foundation::core::uint16 = std::uint16_t
uint32¶
using ludus::foundation::core::uint32 = std::uint32_t
uint64¶
using ludus::foundation::core::uint64 = std::uint64_t
uint8¶
using ludus::foundation::core::uint8 = std::uint8_t
usize¶
using ludus::foundation::core::usize = std::size_t