TypeLibraries
Ledger
A per-player balance of one currency, saved in the data store as each change is made. Amounts given to canAfford, earn and spend must be zero or more; a negative one raises.
Fields
Methods
The player's balance; the opening balance if they have never had one.
Whether the balance is at least amount.
Takes amount if the player can afford it and returns true. false leaves the balance alone
Sets the balance outright; any whole value, negative included.
Sets the balance back to what ledger.open gave as the start. back to the opening balance