载入中...
搜索中...
未找到
Item.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5// 物品定义注册表:数据驱动的 ItemDefinition(C++ 注册或 JSON 批量加载)。
6
8
9#include <string>
10#include <unordered_map>
11
12namespace eve::inventory {
13
16public:
18 static void registerItem(const ItemDefinition &def);
20 static const ItemDefinition *find(const std::string &id);
22 static bool remove(const std::string &id);
24 static void clear();
26 static int count();
27
38 static int loadFromJson(const std::string &json, std::string *error = nullptr);
39
40private:
41 static std::unordered_map<std::string, ItemDefinition> &table();
42};
43
44} // namespace eve::inventory
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::string error
Definition Package.cpp:60
std::uint32_t count
EVENGINE_API_FOUNDATION public API.
Definition Item.h:15
运行时容器:固定格数的背包 / 箱子 / 商店栏等。 行为由 InventorySystem 提供;本类暴露便于脚本绑定的薄封装方法。
物品模板(进程级注册表中的定义,不含运行时数量)。
Definition ItemTypes.h:15