|
| static eve::definitions::DefinitionRegistry & | definitionRegistry () |
| | Return the common registry that owns canonical skill JSON.
|
| |
| static void | registerSkill (const SkillDefinition &def) |
| |
| static const SkillDefinition * | find (const std::string &id) |
| | Find a registered skill 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": "fireball", "cooldown": 4, "castTime": 1.2, "targetType": "single", "costs": [{"attribute":"mana","amount":20}], "grantedEffects": ["burning"], "tags": ["fire"], "extra": {"projectile": "fireball_vfx"} }
|
| |
EVENGINE_API_PLATFORM public API.
在文件 Skill.h 第 46 行定义.
| int eve::rpg::SkillRegistry::loadFromJson |
( |
const std::string & |
json, |
|
|
std::string * |
error = nullptr |
|
) |
| |
|
static |
从 JSON 数组批量注册技能定义,返回成功注册数量。元素形如: { "id": "fireball", "cooldown": 4, "castTime": 1.2, "targetType": "single", "costs": [{"attribute":"mana","amount":20}], "grantedEffects": ["burning"], "tags": ["fire"], "extra": {"projectile": "fireball_vfx"} }
在文件 Skill.cpp 第 163 行定义.
引用了 error, eve::rpg::SkillDefinition::id, n, eve::json::Document::parse(), registerSkill(), eve::json::Document::root(), root , 以及 eve::json::Document::valid().
被这些函数引用 eve::rpg::RPG::registerSkillsFromJson().