载入中...
搜索中...
未找到
EquipmentSystem.h
浏览该文件的文档.
1#pragma once
2
14#include "common/Result.h"
15
16#include <span>
17#include <string>
18#include <string_view>
19#include <vector>
20
21#include "common/Export.h"
22
23namespace eve::inventory {
24class EquipmentSet;
25}
26
27namespace eve::rpg {
28
29class RPGActor;
30
33 std::string attribute;
34 std::string op = "add";
35 double value = 0.0;
36 int priority = 0;
37};
38
44public:
46 static void registerItemStat(const std::string &itemId, const EquipmentStat &stat);
48 static int registerItemStatsFromJson(const std::string &itemId, const std::string &json);
50 static void clearItemStats(const std::string &itemId);
52 static void clearAll();
54 static int statItemCount();
55
60 static int syncEquipModifiers(RPGActor *actor, eve::inventory::EquipmentSet *equip);
70 [[nodiscard]] static eve::Result<int> projectSlot(RPGActor& actor, std::string_view slot,
71 std::span<const EquipmentStat> stats);
72};
73
74} // namespace eve::rpg
LogicalId itemId
#define EVENGINE_API_PLATFORM
Definition Export.h:107
std::string slot
std::vector< EquipmentStat > stats
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
EVENGINE_API_FOUNDATION public API.
Definition Equipment.h:19
装备加成系统。 @thread 调用线程应与 RPGActor 的 ECS 线程一致。
属性 / 状态 / 技能三表合一的 ECS 实体。
Definition RPGActor.h:34
运行时容器:固定格数的背包 / 箱子 / 商店栏等。 行为由 InventorySystem 提供;本类暴露便于脚本绑定的薄封装方法。
RPG 模块的基础实体:把属性 / 状态 / 技能三张表挂到一个 ECS 实体上。
一件物品的一条属性加成规格。