Currency / Reason Text¶
Purpose¶
ReasonText.Currency provides human-readable messages for currency operation results.
It converts:
CurOpCode→ readable stringCurOpResult→ readable reason (preferringMessagewhen available)
This utility is used by UI, logging, diagnostics, and teaching panels to present consistent wording.
Important Notes¶
- This helper is for presentation only
- Messages are developer-facing by default
- Player-facing UI should provide its own copy or localisation
- Behaviour does not affect currency logic
What Lives Here¶
ReasonText.Currency¶
Maps currency operation results to readable strings.
Supported inputs:
CurOpCodeCurOpResult
Usage Guidance¶
Behaviour¶
- Returns
result.Messagewhen available - Otherwise returns a mapped string for
CurOpCode - Returns an empty string for success (
Ok)
Example¶
var r = svc.Debit(player, gold, 500);
Debug.Log(ReasonText.Currency(r));
Diagnostics¶
- Unexpected messages may indicate custom
Messagevalues are provided - Missing mappings may require extending the helper when new codes are introduced
Internal Use Only¶
This helper is part of the public UX surface.
Do not:
- Depend on specific wording for gameplay logic
- Use messages as control flow
Safe to Remove¶
This folder may be removed if standardised messaging is not required.
Currency logic is not affected.
Related Documentation¶
- Abstractions —
CurOpCode,CurOpResult - UI — components displaying currency state
- Teaching — panels displaying currency feedback