Editable floor-by-floor house generation with an owning component-library snapshot. 更多...
#include <HouseGeneration.h>
Public 成员函数 | |
| HouseGeneration () | |
| Construct an inexpensive empty session. | |
| ~HouseGeneration () | |
| Release staging data without publishing entities. | |
| HouseGeneration (const HouseGeneration &)=delete | |
| HouseGeneration & | operator= (const HouseGeneration &)=delete |
| HouseGeneration (HouseGeneration &&) noexcept | |
| Transfer ownership of staging data. | |
| HouseGeneration & | operator= (HouseGeneration &&) noexcept |
| Transfer ownership, releasing the previous staging data. | |
| Result< void > | configure (const HouseRequest &request, const HouseComponentLibrary &library) |
| Validate the request and copy the library; success resets all intermediate floors. @cost Linear in component definitions; amortized over every floor generated by this session. | |
| Result< procgen::Grid2D > | nextFloorGrid () |
| Prepare the next default mask and return an independent GridGraph-compatible copy. Repeated calls before emission return the same mask without consuming more random numbers. @cost Linear in plot cells, much cheaper than component placement; edit the returned grid in a graph. | |
| Result< void > | emitFloor (const procgen::Grid2D &grid, const std::vector< std::string > &roomTypes) |
| Emit a caller-edited, same-size floor with caller-selected room types. Upper floors must be supported by the previous floor and retain any stair column. @cost Linear in plot cells plus component selection and room boundaries; emits one floor per call. | |
| Result< HouseLayout > | finish () const |
| Validate and return an independent complete layout; never publishes ECS entities. @cost Linear in emitted instances and occupied cells; call once after emitting all requested floors. | |
| int | floorCount () const noexcept |
| Number of successfully emitted floors; zero for empty or moved-from sessions. | |
详细描述
Editable floor-by-floor house generation with an owning component-library snapshot.
- 备注
- The session owns all intermediate data. No library references, VM objects or ECS identities are retained. Failed configuration, floor emission or validation preserves the prior session. Defaults preserve the legacy RNG schedule within one build/compiler. Persist configuration and seed, not this transient session; rebuild on hot reload. No cross-platform bitwise float guarantee is made. @thread Owner thread only; synchronous, no callbacks or reentrant calls.
在文件 HouseGeneration.h 第 29 行定义.
构造及析构函数说明
◆ HouseGeneration() [1/3]
|
default |
Construct an inexpensive empty session.
◆ ~HouseGeneration()
|
default |
Release staging data without publishing entities.
◆ HouseGeneration() [2/3]
|
delete |
◆ HouseGeneration() [3/3]
|
defaultnoexcept |
Transfer ownership of staging data.
成员函数说明
◆ configure()
| Result< void > eve::housegen::HouseGeneration::configure | ( | const HouseRequest & | request, |
| const HouseComponentLibrary & | library | ||
| ) |
Validate the request and copy the library; success resets all intermediate floors. @cost Linear in component definitions; amortized over every floor generated by this session.
在文件 HouseGeneration.cpp 第 33 行定义.
引用了 request, result , 以及 eve::Result< T >::success().
◆ emitFloor()
| Result< void > eve::housegen::HouseGeneration::emitFloor | ( | const procgen::Grid2D & | grid, |
| const std::vector< std::string > & | roomTypes | ||
| ) |
Emit a caller-edited, same-size floor with caller-selected room types. Upper floors must be supported by the previous floor and retain any stair column. @cost Linear in plot cells plus component selection and room boundaries; emits one floor per call.
在文件 HouseGeneration.cpp 第 53 行定义.
引用了 cell, eve::housegen::house_detail::findInteriorCell(), name, r, result, size, eve::Result< T >::success(), x , 以及 y.
◆ finish()
| Result< HouseLayout > eve::housegen::HouseGeneration::finish | ( | ) | const |
Validate and return an independent complete layout; never publishes ECS entities. @cost Linear in emitted instances and occupied cells; call once after emitting all requested floors.
在文件 HouseGeneration.cpp 第 87 行定义.
引用了 eve::Result< T >::failure(), result, status , 以及 eve::Result< T >::success().
◆ floorCount()
|
noexcept |
Number of successfully emitted floors; zero for empty or moved-from sessions.
在文件 HouseGeneration.cpp 第 43 行定义.
◆ nextFloorGrid()
| Result< procgen::Grid2D > eve::housegen::HouseGeneration::nextFloorGrid | ( | ) |
Prepare the next default mask and return an independent GridGraph-compatible copy. Repeated calls before emission return the same mask without consuming more random numbers. @cost Linear in plot cells, much cheaper than component placement; edit the returned grid in a graph.
在文件 HouseGeneration.cpp 第 45 行定义.
引用了 eve::Result< T >::failure(), result, status , 以及 eve::Result< T >::success().
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
defaultnoexcept |
Transfer ownership, releasing the previous staging data.
该类的文档由以下文件生成:
- src/modules/procgen/house/HouseGeneration.h
- src/modules/procgen/house/HouseGeneration.cpp