载入中...
搜索中...
未找到
ResourceType.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <string>
6#include <unordered_map>
7
8namespace eve::economy {
9
11enum class DepletionModel {
12 Finite, // 采完即枯竭(SC 矿簇)
13 Renewable, // 可再生(AoE 农田复种)
14 Infinite, // 无限供给
15 Growing // 随时间增长(C&C 泰伯利亚)
16};
17
22 std::string id; // 唯一标识("minerals" / "food" ...)
23 std::string category = "stock"; // 存量型 / 速率型 / 特殊(人口)
24 int stockMax = 0; // 玩家持有上限;0 表示不限
26 std::string displayName; // UI 显示名(可空)
27};
28
33public:
35 static bool registerType(const ResourceTypeDef& def);
37 static const ResourceTypeDef* find(const std::string& id);
39 static int count();
47 static const ResourceTypeDef* typeAt(int index);
49 static void clear();
50
51private:
52 static std::unordered_map<std::string, ResourceTypeDef>& types();
53};
54
55} // namespace eve::economy
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::uint32_t count
uint32_t index
资源类型注册表:注册 / 查询 / 清理。
DepletionModel
资源节点的供给模型。
资源类型的静态定义(数据驱动配置的最小单元)。