9#include <unordered_map>
33 static int credit(
int player,
const std::string&
type,
int amount);
35 static bool debit(
int player,
const std::string&
type,
int amount);
38 static int get(
int player,
const std::string&
type);
40 static int getCap(
int player,
const std::string&
type);
42 static int getWasted(
int player,
const std::string&
type);
44 static int getIncome(
int player,
const std::string&
type);
46 static int getExpense(
int player,
const std::string&
type);
58 static void unregisterHook(
const std::string&
name);
61 static void clearEvents();
63 static int eventCount();
71 static std::unordered_map<int, EconomyLedger>& ledgers();
72 static std::vector<EconomyEvent>&
events();
73 static std::unordered_map<std::string, EconomyHook>& hooks();
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
单个玩家的资源账本:当前量、上限、收支与浪费统计。
经济系统门面:按玩家持有账本、转发事件、注册钩子。
std::function< void(const EconomyEvent &)> EconomyHook
SettlementPipeline::Stage fn
一次经济事件(credit / debit / waste)。
Owning deterministic copy of all balance and accounting counters.