载入中...
搜索中...
未找到
eve::economy::ResourceTypeRegistry类 参考
资源类型注册表:注册 / 查询 / 清理。 更多...
#include <ResourceType.h>
静态 Public 成员函数 | |
| static bool | registerType (const ResourceTypeDef &def) |
| 注册或替换一个资源类型定义。 | |
| static const ResourceTypeDef * | find (const std::string &id) |
| 按 id 查询;未注册时返回 nullptr。 | |
| static int | count () |
| 已注册类型数量。 | |
| static const ResourceTypeDef * | typeAt (int index) |
| 按 id 字典序返回第 index 个类型定义。 | |
| static void | clear () |
| 清空注册表(测试用)。 | |
详细描述
资源类型注册表:注册 / 查询 / 清理。
在文件 ResourceType.h 第 32 行定义.
成员函数说明
◆ clear()
|
static |
◆ count()
|
static |
◆ find()
|
static |
按 id 查询;未注册时返回 nullptr。
在文件 ResourceType.cpp 第 19 行定义.
被这些函数引用 eve::economy::EconomyLedger::credit(), eve::economy::EconomyLedger::getCap(), eve::economy::Economy::getStockMax(), eve::economy::Economy::hasType(), eve::economy::EconomyControl::submitGameplay() , 以及 typeAt().
◆ registerType()
|
static |
注册或替换一个资源类型定义。
- 返回
- false 当 id 为空。
在文件 ResourceType.cpp 第 13 行定义.
◆ typeAt()
|
static |
按 id 字典序返回第 index 个类型定义。
- 参数
-
index 从 0 开始的序号。
- 返回
- 借用注册表内的定义,越界返回 nullptr;顺序稳定(便于观察与脚本遍历)。 @lifetime The returned pointer is borrowed from the registry: it stays valid until the next
registerType/clearcall on that registry.
在文件 ResourceType.cpp 第 27 行定义.
引用了 find(), ids, index, left, right , 以及 size.
被这些函数引用 eve::economy::Economy::getTypeId().
该类的文档由以下文件生成:
- src/modules/economy/ResourceType.h
- src/modules/economy/ResourceType.cpp