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 bool | isObjectivesSatisfied (const Tracker &t, const std::string &id) |
| 按定义的 objectivePolicy / optional 判定条目目标是否已满足完成条件。 | |
| static std::string | dialoguePhase (const Tracker &t, const std::string &questId) |
| 将 Tracker 状态映射为对话相位后缀:offer|active|turnin|completed|failed。 | |
| static std::string | dialogueConversationId (const Tracker &t, const std::string &questId, const std::string &dialogueBase) |
| 拼接 dialogueBase + "." + dialoguePhase;相位或 base 为空时返回空串。 | |
| static int | applyClock (Tracker *t, double nowSeconds) |
| 武装未设 deadline 的限时条目,并 fail 已过期的 active/ready(reason=expired)。 | |
| static int | refreshByKey (Tracker *t, const std::string &refreshKey, const std::string &stamp) |
| 对 refreshKey 匹配的条目,若 stamp 与 refreshStamp 不同则 reset 并写入新 stamp。 | |
| static void | pollEvents (Tracker *t, std::vector< QuestEvent > &out) |
| 把 Tracker 的 pending 移动并清空到 out。 | |
详细描述
EVENGINE_API_PLATFORM public API.
在文件 QuestSystem.h 第 25 行定义.
成员函数说明
◆ abandon()
|
static |
abandon/fail → failed;对 completed/failed/locked/未知 id 为 reject(compatibility facade (脚本兼容门面))。
引用了 t.
被这些函数引用 eve::rpg::Tracker::abandon().
◆ activate()
|
static |
激活:仅 inactive 且前置已齐时成功;否则 push reject 并返回 false(compatibility facade (脚本兼容门面))。
引用了 canActivateReason(), eve::rpg::QuestRegistry::find(), id , 以及 t.
被这些函数引用 eve::rpg::Tracker::activate().
◆ applyClock()
|
static |
武装未设 deadline 的限时条目,并 fail 已过期的 active/ready(reason=expired)。
- 参数
-
nowSeconds 游戏提供的单调或墙钟秒;与 deadlineAt 同一时间轴。
- 返回
- 因过期而失败的条目数。 @cost Low — linear in Tracker entry count; call on a coarse cadence (seconds), not every frame.
引用了 eve::rpg::QuestRuntime::deadlineAt, eve::rpg::QuestRegistry::find(), eve::rpg::QuestRuntime::state, t , 以及 eve::rpg::QuestDefinition::timeLimitSeconds.
被这些函数引用 eve::rpg::Tracker::applyClock().
◆ canActivate()
|
static |
是否可激活(谓词查询,可返回 reason)。
引用了 canActivateReason(), r , 以及 t.
被这些函数引用 eve::rpg::Tracker::canActivate().
◆ canActivateReason()
|
static |
不可激活的原因("" 可激活,否则 unknown/locked/alreadyActive/alreadyCompleted/failed/ready)。
引用了 eve::rpg::QuestRegistry::find(), hasMetRequirements(), state , 以及 t.
被这些函数引用 activate(), canActivate() , 以及 eve::rpg::Tracker::canActivateReason().
◆ claim()
|
static |
仅 state==ready 时成功 → completed 并触发解锁;否则 reject(compatibility facade (脚本兼容门面))。
引用了 id, syncAuto() , 以及 t.
被这些函数引用 eve::rpg::Tracker::claim() , 以及 eve::rpg::QuestReward::claim().
◆ dialogueConversationId()
|
static |
拼接 dialogueBase + "." + dialoguePhase;相位或 base 为空时返回空串。
引用了 dialoguePhase(), phase , 以及 t.
◆ dialoguePhase()
|
static |
将 Tracker 状态映射为对话相位后缀:offer|active|turnin|completed|failed。
- 备注
- locked/inactive → offer;active → active;ready → turnin;其余原样。 未知 id 返回空串。与 rpg-classic quest_npc 的 dialogueBase.phase 约定一致。
被这些函数引用 dialogueConversationId() , 以及 eve::rpg::Tracker::dialoguePhase().
◆ fail()
|
static |
◆ hasMetRequirements()
|
static |
def 的全部 requires 在本 Tracker 上均已 completed(谓词查询)。
引用了 eve::rpg::QuestDefinition::requiresIds , 以及 t.
被这些函数引用 canActivateReason(), reset() , 以及 syncAuto().
◆ isObjectivesSatisfied()
|
static |
按定义的 objectivePolicy / optional 判定条目目标是否已满足完成条件。
- 备注
- 空目标列表视为已满足。unknown id / 无定义时回退为「全部 ObjectiveRuntime.done」。
引用了 eve::rpg::QuestRegistry::find() , 以及 t.
被这些函数引用 eve::rpg::Tracker::isObjectivesSatisfied() , 以及 eve::rpg::Tracker::restoreSnapshotJson().
◆ notify()
|
static |
报告事实 (topic, target, amount);只推进 state==active 的条目。
引用了 eve::rpg::QuestRegistry::find(), id, n, eve::rpg::QuestDefinition::objectives, t , 以及 target.
被这些函数引用 eve::rpg::Tracker::notify().
◆ pollEvents()
|
static |
◆ refreshByKey()
|
static |
对 refreshKey 匹配的条目,若 stamp 与 refreshStamp 不同则 reset 并写入新 stamp。
- 返回
- 实际 reset 的条目数。 @cost Low — linear in Tracker entry count per calendar-key change.
引用了 eve::rpg::QuestRegistry::find(), ids, eve::rpg::QuestDefinition::refreshKey, reset(), stamp , 以及 t.
被这些函数引用 eve::rpg::Tracker::refreshByKey().
◆ reset()
|
static |
进度清零并按当前 requires 回落 locked/inactive/active;不级联(compatibility facade (脚本兼容门面))。
引用了 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.
被这些函数引用 refreshByKey() , 以及 eve::rpg::Tracker::reset().
◆ stateForUnlocked()
|
static |
解锁后的落点:startPolicy==auto → "active",否则 "inactive"。
引用了 eve::rpg::QuestDefinition::startPolicy.
被这些函数引用 reset() , 以及 syncAuto().
◆ syncAuto()
|
static |
补建 Registry 里尚不在 Tracker 上的条目,并解开前置已齐的 locked 条目。
引用了 changed, 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/Quest.cpp