EVENGINE_API_PLATFORM public API. 更多...
#include <QuestSystem.h>
静态 Public 成员函数 | |
| static void | syncAuto (Tracker *t) |
| 补建 Registry 里尚不在 Tracker 上的条目,并解开前置已齐的 locked 条目。 | |
| static bool | hasMetRequirements (const Tracker &t, const QuestDefinition &def) |
| def 的全部 requires 在本 Tracker 上均已 completed(谓词查询)。 | |
| static std::string | stateForUnlocked (const QuestDefinition &def) |
| 解锁后的落点:startPolicy==auto → "active",否则 "inactive"。 | |
| static bool | activate (Tracker *t, const std::string &id, std::string *reason=nullptr) |
| 激活:仅 inactive 且前置已齐时成功;否则 push reject 并返回 false(compatibility facade (脚本兼容门面))。 | |
| static bool | canActivate (Tracker *t, const std::string &id, std::string *reason=nullptr) |
| 是否可激活(谓词查询,可返回 reason)。 | |
| static std::string | canActivateReason (Tracker *t, const std::string &id) |
| 不可激活的原因("" 可激活,否则 unknown/locked/alreadyActive/alreadyCompleted/failed/ready)。 | |
| static void | notify (Tracker *t, const std::string &topic, const std::string &target, int amount) |
| 报告事实 (topic, target, amount);只推进 state==active 的条目。 | |
| static bool | claim (Tracker *t, const std::string &id, std::string *reason=nullptr) |
| 仅 state==ready 时成功 → completed 并触发解锁;否则 reject(compatibility facade (脚本兼容门面))。 | |
| static bool | reset (Tracker *t, const std::string &id) |
| 进度清零并按当前 requires 回落 locked/inactive/active;不级联(compatibility facade (脚本兼容门面))。 | |
| static bool | abandon (Tracker *t, const std::string &id) |
| abandon/fail → failed;对 completed/failed/locked/未知 id 为 reject(compatibility facade (脚本兼容门面))。 | |
| static bool | fail (Tracker *t, const std::string &id, const std::string &reason) |
| Fail. | |
| static void | pollEvents (Tracker *t, std::vector< QuestEvent > &out) |
| 把 Tracker 的 pending 移动并清空到 out。 | |
详细描述
EVENGINE_API_PLATFORM public API.
在文件 QuestSystem.h 第 24 行定义.
成员函数说明
◆ abandon()
|
static |
abandon/fail → failed;对 completed/failed/locked/未知 id 为 reject(compatibility facade (脚本兼容门面))。
在文件 QuestSystem.cpp 第 238 行定义.
引用了 t.
被这些函数引用 eve::rpg::Tracker::abandon().
◆ activate()
|
static |
激活:仅 inactive 且前置已齐时成功;否则 push reject 并返回 false(compatibility facade (脚本兼容门面))。
在文件 QuestSystem.cpp 第 122 行定义.
引用了 canActivateReason(), id , 以及 t.
被这些函数引用 eve::rpg::Tracker::activate().
◆ canActivate()
|
static |
是否可激活(谓词查询,可返回 reason)。
在文件 QuestSystem.cpp 第 116 行定义.
引用了 canActivateReason(), r , 以及 t.
被这些函数引用 eve::rpg::Tracker::canActivate().
◆ canActivateReason()
|
static |
不可激活的原因("" 可激活,否则 unknown/locked/alreadyActive/alreadyCompleted/failed/ready)。
在文件 QuestSystem.cpp 第 100 行定义.
引用了 eve::rpg::QuestRegistry::find(), hasMetRequirements(), state , 以及 t.
被这些函数引用 activate(), canActivate() , 以及 eve::rpg::Tracker::canActivateReason().
◆ claim()
|
static |
仅 state==ready 时成功 → completed 并触发解锁;否则 reject(compatibility facade (脚本兼容门面))。
在文件 QuestSystem.cpp 第 174 行定义.
引用了 id, syncAuto() , 以及 t.
被这些函数引用 eve::rpg::Tracker::claim() , 以及 eve::rpg::QuestReward::claim().
◆ fail()
|
static |
◆ hasMetRequirements()
|
static |
def 的全部 requires 在本 Tracker 上均已 completed(谓词查询)。
在文件 QuestSystem.cpp 第 48 行定义.
引用了 eve::rpg::QuestDefinition::requiresIds , 以及 t.
被这些函数引用 canActivateReason(), reset() , 以及 syncAuto().
◆ notify()
|
static |
报告事实 (topic, target, amount);只推进 state==active 的条目。
在文件 QuestSystem.cpp 第 145 行定义.
引用了 eve::rpg::QuestRegistry::find(), id, n, eve::rpg::QuestDefinition::objectives, t , 以及 target.
被这些函数引用 eve::rpg::Tracker::notify().
◆ pollEvents()
|
static |
◆ reset()
|
static |
进度清零并按当前 requires 回落 locked/inactive/active;不级联(compatibility facade (脚本兼容门面))。
在文件 QuestSystem.cpp 第 196 行定义.
引用了 eve::rpg::ObjectiveRuntime::count, eve::rpg::ObjectiveRuntime::current, eve::rpg::ObjectiveRuntime::done, eve::rpg::QuestRegistry::find(), hasMetRequirements(), id, eve::rpg::ObjectiveRuntime::id, eve::rpg::QuestDefinition::objectives, eve::rpg::QuestRuntime::objectives, eve::rpg::QuestRuntime::state, stateForUnlocked() , 以及 t.
被这些函数引用 eve::rpg::Tracker::reset().
◆ stateForUnlocked()
|
static |
解锁后的落点:startPolicy==auto → "active",否则 "inactive"。
在文件 QuestSystem.cpp 第 57 行定义.
引用了 eve::rpg::QuestDefinition::startPolicy.
被这些函数引用 reset() , 以及 syncAuto().
◆ syncAuto()
|
static |
补建 Registry 里尚不在 Tracker 上的条目,并解开前置已齐的 locked 条目。
在文件 QuestSystem.cpp 第 61 行定义.
引用了 eve::rpg::ObjectiveRuntime::count, eve::rpg::ObjectiveRuntime::current, eve::rpg::ObjectiveRuntime::done, eve::rpg::QuestRegistry::find(), hasMetRequirements(), id, eve::rpg::ObjectiveRuntime::id, eve::rpg::QuestRuntime::id, eve::rpg::QuestRegistry::ids(), eve::rpg::QuestDefinition::objectives, eve::rpg::QuestRuntime::objectives, eve::rpg::QuestRuntime::state, stateForUnlocked() , 以及 t.
被这些函数引用 claim(), eve::rpg::Tracker::syncAuto() , 以及 eve::rpg::Tracker::Tracker().
该类的文档由以下文件生成:
- src/modules/rpg/QuestSystem.h
- src/modules/rpg/QuestSystem.cpp