载入中...
搜索中...
未找到
HouseGen.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Module.h"
7
8namespace eve::housegen {
9
11class HouseGen : public Module {
12public:
15 bool loadComponentsFromJson(const std::string &json);
16 bool loadComponentsFromFile(const std::string &filename);
18 void clearComponents();
20 int getComponentCount() const;
25 bool generate(HouseRequest *request, HouseLayout *layout);
27 std::string lastError() const;
29 HouseComponentLibrary &library() { return library_; }
30 const HouseComponentLibrary &library() const { return library_; }
31
32private:
33 HouseComponentLibrary library_;
34 std::string lastError_;
35};
36
37} // namespace eve::housegen
std::string layout
房屋组件注册表(按 id 索引,支持分类/风格查询)。
程序化房屋生成模块(eve.HouseGen):组件库 + 布局生成。
Definition HouseGen.h:11
bool loadComponentsFromJson(const std::string &json)
从 JSON / 文件加载房屋组件库。
Definition HouseGen.cpp:11
HouseRequest * newRequest()
工厂:生成请求 / 布局。
Definition HouseGen.cpp:15
bool loadComponentsFromFile(const std::string &filename)
Definition HouseGen.cpp:12
int getComponentCount() const
组件数量。
Definition HouseGen.cpp:14
void clearComponents()
清空组件库。
Definition HouseGen.cpp:13
HouseLayout * newLayout()
Definition HouseGen.cpp:16
const HouseComponentLibrary & library() const
Definition HouseGen.h:30
bool generate(HouseRequest *request, HouseLayout *layout)
按请求生成布局;失败返回 false 并记录 lastError。
Definition HouseGen.cpp:17
std::string lastError() const
最近一次失败原因。
Definition HouseGen.cpp:22
HouseComponentLibrary & library()
组件库(可直接访问)。
Definition HouseGen.h:29
一次生成的房屋布局:实例 + 房间 + 元信息,可 JSON 序列化 / 实例化。
Definition HouseLayout.h:16
一次房屋生成请求(参数集)。