Open the casino against a home #46

Closed
opened 2026-08-15 18:58:44 +00:00 by rosa · 0 comments
Owner

What to build

The casino still finds its own files. Opening it reaches for a home internally,
which means the whole object — bankroll loading, first-run gift, statistics,
saving — can only ever be exercised against the player's real directories.

Hand it one instead. Opening the casino takes a Home, it holds the Files
settled from that home and its config, and it saves through them rather than
through paths carried on the config. Constructing the home moves up to where the
program starts, which is the only place that should be deciding whose files
these are.

Two things fall out. The Default derive on the casino goes: a casino with no
files is not a thing, and the derive existed only so the constructor could fill
itself in from it — which is also what forced the config to be cloned twice on
the way in. Both clones go with it.

Acceptance criteria

  • A casino can be opened against a temp directory and plays a round without
    touching the real home
  • A first run with no save file still starts the player on Mister Green's
    gift
  • An existing save file is still loaded, and saving still writes back to the
    same place the config named
  • The casino no longer derives Default, and the config is not cloned to
    construct one
  • No CHANGELOG entry — nothing here is visible to a player

Blocked by

## What to build The casino still finds its own files. Opening it reaches for a home internally, which means the whole object — bankroll loading, first-run gift, statistics, saving — can only ever be exercised against the player's real directories. Hand it one instead. Opening the casino takes a `Home`, it holds the `Files` settled from that home and its config, and it saves through them rather than through paths carried on the config. Constructing the home moves up to where the program starts, which is the only place that should be deciding whose files these are. Two things fall out. The `Default` derive on the casino goes: a casino with no files is not a thing, and the derive existed only so the constructor could fill itself in from it — which is also what forced the config to be cloned twice on the way in. Both clones go with it. ## Acceptance criteria - [ ] A casino can be opened against a temp directory and plays a round without touching the real home - [ ] A first run with no save file still starts the player on Mister Green's gift - [ ] An existing save file is still loaded, and saving still writes back to the same place the config named - [ ] The casino no longer derives `Default`, and the config is not cloned to construct one - [ ] No CHANGELOG entry — nothing here is visible to a player ## Blocked by - #45
rosa closed this issue 2026-08-16 13:07:03 +00:00
Sign in to join this conversation.
No description provided.