载入中...
搜索中...
未找到
HouseGenerationConfigure.cpp
浏览该文件的文档.
13 eve::DiagnosticCode::InvalidArgument, "house needs a 3x3 plot, at least one floor and one attempt", {}, {},
16 if (!std::isfinite(r.moduleSize) || r.moduleSize <= 0.f || !std::isfinite(r.floorHeight) || r.floorHeight <= 0.f)
18 eve::DiagnosticCode::InvalidArgument, "moduleSize and floorHeight must be finite and positive", {}, {},
39 eve::DiagnosticCode::NotFound, "library needs foundation, floor, wall, door and roof categories", {}, {},
47 "style pack '" + r.style + "' is incomplete (needs foundation, floor, wall, door and roof)", {}, {},
58 eve::DiagnosticCode::NotFound, "multi-room generation needs interior_wall and interior_door categories",
67 static constexpr SocketDirection sides[] = {SocketDirection::North, SocketDirection::East, SocketDirection::South,
73 const SocketDirection entranceDirection = r.entrance == "auto" ? sides[rng() % 4] : directionFromName(r.entrance);
87 eve::DiagnosticCode::Unsupported, "multi-floor house needs an interior cell for a stairwell", {}, {},
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
std::vector< std::reference_wrapper< const HouseComponent > > byCategory(std::string_view category, std::string_view style={}) const
按分类(可选风格)查询组件。
Definition HouseComponentLibrary.cpp:236
bool hasCompletePack(std::string_view style) const
报告一个风格是否构成完整组件包。
Definition HouseComponentLibrary.cpp:250
std::vector< uint8_t > footprintMask
Definition HouseLayout.h:36
int footprintWidth
Canonical base-floor occupancy mask owned by this layout.
Definition HouseLayout.h:34
std::string directionName(SocketDirection direction)
Definition HouseGenerationAlgorithms.cpp:61
std::vector< uint8_t > polygonMask(const std::vector< HousePolygonPoint > &poly, int width, int depth, int inset)
Rasterize an arbitrary closed polygon onto the cell grid (cell centers inside).
Definition HouseGenerationAlgorithms.cpp:111
bool isOneOf(const std::string &value, std::initializer_list< const char * > options)
Definition HouseGenerationAlgorithms.cpp:48
SocketDirection directionFromName(const std::string &name)
Definition HouseGenerationAlgorithms.cpp:54
std::optional< std::pair< int, int > > findInteriorCell(const std::vector< uint8_t > &mask, int width, int depth)
First active cell that is interior (all four orthogonal neighbours active).
Definition HouseGenerationAlgorithms.cpp:155
bool has(const std::vector< std::reference_wrapper< const HouseComponent > > &values)
Definition HouseGenerationAlgorithms.cpp:18
std::vector< uint8_t > footprintMask(const std::string &shape, int width, int depth, int inset)
Internal footprintMask stage helper. @cost Linear in plot cells; reuse for one floor emission.
Definition HouseGenerationAlgorithms.cpp:75
@ InvalidArgument
@ NotFound
@ Unsupported
std::vector< HousePolygonPoint > perimeter
自由轮廓占地顶点(footprint="polygon" 时必填,至少 3 个,角坐标)。
Definition HouseGenTypes.h:81
std::vector< std::string > requiredRooms
Definition HouseGenTypes.h:86
eve::Result< void > configure()
Definition HouseGenerationConfigure.cpp:10
std::optional< std::pair< int, int > > stairwell
Definition HouseGenerationState.h:67
HouseLayout generated
Definition HouseGenerationState.h:63
HouseComponentLibrary library_
Definition HouseGenerationState.h:62
eve::Result< void > floor(const procgen::Grid2D &grid, const std::vector< std::string > &rooms)
Definition HouseGenerationFloor.cpp:5
std::vector< uint8_t > baseMask
Definition HouseGenerationState.h:66
std::vector< uint8_t > makeMask(int ins) const
Internal makeMask stage helper. @cost Linear in plot cells times polygon vertices for polygon footpri...
Definition HouseGenerationConfigure.cpp:4