载入中...
搜索中...
未找到
EconomySystem.cpp
浏览该文件的文档.
105int EconomySystem::getCap(int player, const std::string& type) { return ledger(player).getCap(type); }
107int EconomySystem::getWasted(int player, const std::string& type) { return ledger(player).getWasted(type); }
109int EconomySystem::getIncome(int player, const std::string& type) { return ledger(player).getIncome(type); }
111int EconomySystem::getExpense(int player, const std::string& type) { return ledger(player).getExpense(type); }
113EconomyLedger::Snapshot EconomySystem::snapshot(int player) { return ledger(player).snapshot(); }
EVEngine assertion entry point, backed by zeroerr.
#define EV_PARAM_CHECK(cond,...)
Validate a function parameter / public API precondition.
Definition Assert.h:30
Resource-account adapter backed by an EconomyLedger.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Snapshot snapshot() const
Capture every ledger counter in deterministic key order.
Definition EconomyLedger.cpp:72
static int credit(int player, const std::string &type, int amount)
入账并广播事件。
Definition EconomySystem.cpp:89
static void registerHook(const std::string &name, EconomyHook fn)
注册事件钩子(同名替换)。
Definition EconomySystem.cpp:115
static bool debit(int player, const std::string &type, int amount)
出账并广播事件;余额不足返回 false。
Definition EconomySystem.cpp:97
static EconomyLedger::Snapshot snapshot(int player)
取一个玩家账本的完整只读快照(含未注册类型的余额与流水)。
Definition EconomySystem.cpp:113
static std::shared_ptr< resource::IResourceAccount > resourceAccount(int player)
Share a cached protocol adapter over the canonical player ledger. @ownership The adapter is shared; E...
Definition EconomySystem.cpp:56
static int getCap(int player, const std::string &type)
玩家该类型持有上限(0=不限)。
Definition EconomySystem.cpp:105
Definition IEconomy.h:5
std::function< void(const EconomyEvent &)> EconomyHook
Definition EconomySystem.h:24
Result< VehiclePhysicsStatus > commit(physics::World &world, physics::ForceBatch &batch, std::shared_ptr< VehicleWheelRuntime > &runtime, std::vector< VehicleEntity::SuspensionState::WheelState > candidate, const SimulationStep &step)
Definition VehicleTireRuntime.cpp:87
@ StaleHandle
Owning deterministic copy of all balance and accounting counters.
Definition EconomyLedger.h:17