全局效果定义表:进程级单例,供任意模块 / 脚本按 id 引用。 更多...
#include <Effect.h>
静态 Public 成员函数 | |
| static void | registerEffect (const EffectDefinition &def) |
| Registers effect. | |
| static const EffectDefinition * | find (const std::string &id) |
| Find a registered effect definition by id. | |
| static bool | remove (const std::string &id) |
| Removes . | |
| static void | clear () |
| Clears . | |
| static int | count () |
| Returns the number of . | |
| static int | loadFromJson (const std::string &json, std::string *error=nullptr) |
| 从 JSON 数组批量注册效果定义,返回成功注册的数量。 每个元素形如: { "id": "poison", "durationPolicy": "duration", "duration": 5, "period": 1, "stackPolicy": "stack", "maxStacks": 5, "modifiers": [{"attribute":"health","op":"add","value":-5}], "tags": ["debuff", "poison"], "extra": {"icon": "ui/poison.png", "vfx": "fx.poison"} } | |
详细描述
成员函数说明
◆ clear()
|
static |
◆ count()
|
static |
◆ find()
|
static |
Find a registered effect definition by id.
- 返回
- Borrowed nullable definition owned by the process-local registry. @ownership EffectRegistry owns the definition; callers must not delete or mutate it. @lifetime Valid until remove(), clear(), or replacement of the same id; copy data before registry mutation. @thread Call on the RPG registry thread. @reentrancy The lookup does not invoke callbacks and is not valid across re-entrant registry mutation.
在文件 Effect.cpp 第 30 行定义.
引用了 t.
被这些函数引用 eve::rpg::StatusSystem::apply(), eve::rpg::makeStatusTickSettlementRequest() , 以及 eve::rpg::StatusSystem::update().
◆ loadFromJson()
|
static |
从 JSON 数组批量注册效果定义,返回成功注册的数量。 每个元素形如: { "id": "poison", "durationPolicy": "duration", "duration": 5, "period": 1, "stackPolicy": "stack", "maxStacks": 5, "modifiers": [{"attribute":"health","op":"add","value":-5}], "tags": ["debuff", "poison"], "extra": {"icon": "ui/poison.png", "vfx": "fx.poison"} }
在文件 Effect.cpp 第 71 行定义.
引用了 error, eve::rpg::EffectDefinition::id, n, eve::json::Document::parse(), registerEffect(), eve::json::Document::root(), root , 以及 eve::json::Document::valid().
◆ registerEffect()
|
static |
Registers effect.
在文件 Effect.cpp 第 25 行定义.
引用了 eve::rpg::EffectDefinition::id.
被这些函数引用 loadFromJson().
◆ remove()
|
static |
Removes .
在文件 Effect.cpp 第 36 行定义.
该类的文档由以下文件生成:
- src/modules/rpg/Effect.h
- src/modules/rpg/Effect.cpp