ludic/packages/ludic.wallet
2026-09-28 20:03:46 +03:00
..
tests refactor(packages): 0.R5 - a question no longer starts its state - 64 lazy starts ('if st.x == null { st.x = ... }' inside a getter) are the state's defaults, gear__ensure is gone, and ludic migrate state --tighten took mut off 208 package parameters: things_all, thing_find, gear_charge, gear_level, jobs_state and the rest read 2026-09-27 00:51:03 +03:00
index.ludic refactor(packages): the mechanic packages use ludic_base only, and ask through ports 2026-09-25 05:36:11 +03:00
package.ludic feat(ludic.inventory, ludic.wallet): the pack and the purse as mechanic packages 2026-09-25 04:29:17 +03:00
README.md feat(ludic.inventory, ludic.wallet): the pack and the purse as mechanic packages 2026-09-25 04:29:17 +03:00
wallet.ludic ludic.base: a queue's fact records come round again (q_rec / q_ring_add), used by effects, clock, wallet, weather, tracks, needs, fire, settings, update, steps, crafting, shop, gear, hints, session and photo instead of a new record per fact; the minimap's marks cleared and rubbed out in place, its scale steps without a list; the clock's dice seeded again, not made again; once-per-join, per-save and pool-miss paths declared 2026-09-28 20:03:46 +03:00

ludic.wallet

Money carried, in whole units: earned, spent only when it is there, lost when a cost happens anyway, and every change reported. Uses ludic.base and nothing else. Prices, reputation and what a thing costs are the game's; the wallet only holds the money.

import "ludic.wallet"

No ports: the wallet asks the world nothing.

API

wallet_money(), wallet_can(n) what is there, and whether n is
wallet_earn(n) add
wallet_spend(n) -> bool only what is there: false, and nothing spent, when it is not
wallet_lose(n) a cost that happens whether or not it can be paid (a rescue); never below zero
wallet_set(n) exactly n (a starting purse, a correction, the network's word)
wallet_changes() -> Queue<MoneyChanged> the facts: { before, after }, one per change
wallet_system() -> System "wallet", PH_COMMIT: reset, and its save section (wallet_save, wallet_load)

Tests

ludic build packages/ludic.wallet/tests/wallet_test.ludic --headless -o /tmp/wallet_test && /tmp/wallet_test