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