19#include <unordered_map>
25struct EffectDefinition;
35 const std::string &
source, std::string &outReason)>;
54 static void unregisterApplyCondition(
const std::string &
name);
56 static bool hasApplyCondition(
const std::string &
name);
58 static void clearApplyConditions();
63 static void unregisterStackPolicy(
const std::string &
name);
65 static bool hasStackPolicy(
const std::string &
name);
67 static void clearStackPolicies();
72 static void unregisterLifecycleHook(
const std::string &
name);
74 static bool hasLifecycleHook(
const std::string &
name);
76 static void clearLifecycleHooks();
85 const std::string &
source =
"");
94 static int removeByEffect(
RPGActor *actor,
const std::string &effectId);
97 static int removeBySource(
RPGActor *actor,
const std::string &
source);
100 static int removeByTag(
RPGActor *actor,
const std::string &
tag);
103 static bool hasEffect(
RPGActor *actor,
const std::string &effectId);
105 static bool hasTag(
RPGActor *actor,
const std::string &
tag);
107 static int getActiveCount(
RPGActor *actor);
109 static std::string getActiveEffectId(
RPGActor *actor,
int index);
117 static std::string getActiveSource(
RPGActor *actor,
int index);
120 static std::string getProp(
RPGActor *actor,
int instanceId,
const std::string &
key,
121 const std::string &fallback = {});
123 static bool setProp(
RPGActor *actor,
int instanceId,
const std::string &
key,
124 const std::string &
value);
133 static void pollTicks(std::vector<StatusTickEvent> &out);
136 static void pollChanges(std::vector<StatusChangeEvent> &out);
141 static std::unordered_map<std::string, ApplyCondition> &applyConditions();
142 static std::unordered_map<std::string, StackPolicyFn> &stackPolicies();
143 static std::unordered_map<std::string, LifecycleHook> &lifecycleHooks();
#define EVENGINE_API_PLATFORM
Move-only, checked operation results for the common layer.
const UnitySourceAsset & source
Move-only operation result carrying either a value or Status.
属性 / 状态 / 技能三表合一的 ECS 实体。
EVENGINE_API_PLATFORM public API.
std::function< bool(RPGActor *actor, const EffectDefinition &def, const std::string &source, std::string &outReason)> ApplyCondition
施加前条件:返回 false 表示拒绝施加。 全部已注册条件按注册表遍历(AND);任一失败则 apply 返回 -1 并产生 action="reject" 事件。
std::function< int(RPGActor *actor, StatusInstance &existing, const EffectDefinition &def, const std::string &source)> StackPolicyFn
自定义叠加策略:在已有效果的临时 StatusInstance projection 上运行。
std::function< void(const StatusChangeEvent &ev)> LifecycleHook
生命周期钩子:每次产生 StatusChangeEvent 时同步回调(在事件入队之后)。
RPG 模块的基础实体:把属性 / 状态 / 技能三张表挂到一个 ECS 实体上。
SettlementPipeline::Stage fn
EVENGINE_API_PLATFORM public API.
状态生命周期变更事件(施加 / 刷新 / 叠层 / 延长 / 移除 / 到期 / 拒绝)。 与 StatusTickEvent 分开:tick 是周期性数值触发,change 是实例结构变化。
Legacy RPG projection of one effects::EffectInstance.