载入中...
搜索中...
未找到
eve::rpg::SkillRegistry类 参考

EVENGINE_API_PLATFORM public API. 更多...

#include <Skill.h>

静态 Public 成员函数

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 行定义.

成员函数说明

◆ clear()

void eve::rpg::SkillRegistry::clear ( )
static

Clears .

在文件 Skill.cpp 第 103 行定义.

引用了 eve::rpg::table().

被这些函数引用 eve::rpg::RPG::clearSkillDefinitions().

◆ count()

int eve::rpg::SkillRegistry::count ( )
static

Returns the number of .

在文件 Skill.cpp 第 114 行定义.

引用了 size , 以及 eve::rpg::table().

被这些函数引用 eve::rpg::RPG::getSkillDefinitionCount().

◆ definitionRegistry()

eve::definitions::DefinitionRegistry & eve::rpg::SkillRegistry::definitionRegistry ( )
static

Return the common registry that owns canonical skill JSON.

备注
The registry is process-local and thread-affine, matching the legacy static SkillRegistry contract. Typed runtime adapters bind to it through a generation-qualified DefinitionRef.

在文件 Skill.cpp 第 70 行定义.

被这些函数引用 eve::rpg::SkillDefinitionRuntime::create().

◆ find()

const SkillDefinition * eve::rpg::SkillRegistry::find ( const std::string &  id)
static

Find a registered skill definition by id.

返回
Borrowed nullable definition owned by the process-local registry. @ownership SkillRegistry 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.

在文件 Skill.cpp 第 90 行定义.

引用了 t , 以及 eve::rpg::table().

被这些函数引用 eve::rpg::SkillSystem::beginCast(), eve::rpg::SkillSystem::canCast(), eve::rpg::SkillSystem::getTargetType(), eve::rpg::BattleTacticsCatalogue::replaceFromJsonStrict(), eve::rpg::EncounterCatalogue::replaceFromJsonStrict() , 以及 eve::rpg::SkillSystem::update().

◆ loadFromJson()

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().

◆ registerSkill()

void eve::rpg::SkillRegistry::registerSkill ( const SkillDefinition &  def)
static

◆ remove()

bool eve::rpg::SkillRegistry::remove ( const std::string &  id)
static

Removes .

在文件 Skill.cpp 第 96 行定义.

引用了 eve::rpg::table().


该类的文档由以下文件生成: