载入中...
搜索中...
未找到
HouseGenerator.h
浏览该文件的文档.
1#pragma once
2
4
5#include <string>
6
7namespace eve::housegen {
8
9class HouseLayout;
10
13public:
15 explicit HouseGenerator(const HouseComponentLibrary *library = nullptr) : library_(library) {}
17 void setLibrary(const HouseComponentLibrary *library) { library_ = library; }
19 const HouseComponentLibrary *library() const { return library_; }
21 bool generate(const HouseRequest &request, HouseLayout &out, std::string *error = nullptr) const;
22
23private:
24 const HouseComponentLibrary *library_ = nullptr;
25};
26
27} // namespace eve::housegen
std::string error
房屋组件注册表(按 id 索引,支持分类/风格查询)。
布局生成器:把 HouseRequest 解析为 HouseLayout(组件库驱动)。
void setLibrary(const HouseComponentLibrary *library)
更换组件库。
const HouseComponentLibrary * library() const
当前组件库。
bool generate(const HouseRequest &request, HouseLayout &out, std::string *error=nullptr) const
生成布局;失败返回 false 并写入 error。
HouseGenerator(const HouseComponentLibrary *library=nullptr)
绑定可选组件库(生成时也可用 setLibrary)。
一次生成的房屋布局:实例 + 房间 + 元信息,可 JSON 序列化 / 实例化。
Definition HouseLayout.h:16
一次房屋生成请求(参数集)。