From 1082f3336085c15992ca83d5553c0ba52208d70a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 1 Oct 2026 14:38:08 -0400 Subject: feat: pai gow poker added to the casino --- dev_guide/bank.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dev_guide/bank.md (limited to 'dev_guide/bank.md') diff --git a/dev_guide/bank.md b/dev_guide/bank.md new file mode 100644 index 0000000..ed890a7 --- /dev/null +++ b/dev_guide/bank.md @@ -0,0 +1,26 @@ +# Bank system internals + +Builder-facing bank documentation (booth object, room placement, player +commands) lives in [../building_guide/bank.md](../building_guide/bank.md). +This page covers the engine side. + +## Session state + +`StateBank` (defined in `internal/net/server.go`) is the session state for +the bank interface. Input is routed through `handleBankInput` in +`internal/game/cmd_bank.go`. + +## Player storage + +Bank items are stored in the `Player.Bank` field (`map[int]*InventorySlot`), +saved in character YAML. Bank slots are sequential and reuse freed slots. +There is no slot limit. + +## Command dispatch + +- `bank` is classified as `ClassActive` in `classifyCommand()` +- `bank` case in `executeCommand()` calls `doBank(sess)` +- `doUse()` checks for `"bank"` or `"bank booth"` targets and routes to + `doBank()` +- `doBank()` checks for a `bank_booth` object in the current room +- `handleBankInput()` dispatches deposit/withdraw/browse/leave commands -- cgit v1.2.3