Skip to content

Economy – Internal Utilities

⚠️ Implementation details – not supported public API

Namespace: RevGaming.RevFramework.Economy.Internal.Utilities

These are shared low-level helpers used internally by Economy services and adapters. They exist to keep behaviour consistent and deterministic across the subsystem.

Do not reference these from gameplay code or integrations. They may change without notice.


Components

PriceBundleUtil

Validation + deterministic normalisation for PriceBundle.

Responsibilities: - Validates money and item lines (returns InvalidArgs with clear messages). - Normalises money lines deterministically: - merges duplicate currency ids - detects numeric overflow when summing amounts - produces deterministic ordering (ordinal by id) - Convenience checks: - HasMoney() / HasItems() - Validate() - TryNormalize()

Used internally by: - Shop flows - Crafting flows - Reward flows - Currency-backed ledger adapters

This ensures every economy operation reasons about the same canonical bundle shape.


EcoReasonUtil

Telemetry hygiene helper.

Responsibilities: - Normalises caller-supplied reason strings (trim / default). - Editor-only warnings when reasons are non-canonical (prevents analytics drift). - Player builds avoid the reflection/canonical checks (zero runtime overhead).

Used throughout services and teachable/demo tooling to keep reason strings consistent.


EcoEditorBridge

Editor-only diagnostics bridge.

Responsibilities: - WarnOnce — logs a warning once per unique key per editor session. - WarnThrottle — rate-limits warnings per key over a time window. - Player builds no-op (no logging overhead).

Used by adapters and internal helpers to surface useful warnings without spam.


EconomyOwnerUtil

Stable, readable owner labels for diagnostics.

Responsibilities: - OwnerKey(GameObject) provides a null-safe owner label (primarily for Editor logs).


Key takeaways

  • Internal utilities are not extension points.
  • They exist to guarantee consistency across Economy flows.
  • If you need custom behaviour, extend via supported interfaces and facades, not by depending on these helpers.