Put the config's settings behind accessors #44

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

What to build

Config currently exposes its settings as public fields, which makes the shape
serde reads off the file the same thing the rest of the crate programs against.
Every later change to how a setting is stored — an optional override, a parsed
type in place of a string — has to ripple out to every reader.

Close the type over its own representation: the fields go private and callers
reach the settings through accessors. Nothing changes for a player, and nothing
changes about what the config file holds.

This is groundwork. It is what lets the tickets that follow change how the save
and stats paths are stored without touching a single game module.

Acceptance criteria

  • No caller outside the config module names a Config field directly
  • The blackjack and poker pay tables are still reachable from the games that
    read them
  • An existing config file reads exactly as it did before, key for key
  • No CHANGELOG entry — nothing here is visible to a player

Blocked by

  • None — can start immediately.
## What to build `Config` currently exposes its settings as public fields, which makes the shape serde reads off the file the same thing the rest of the crate programs against. Every later change to how a setting is stored — an optional override, a parsed type in place of a string — has to ripple out to every reader. Close the type over its own representation: the fields go private and callers reach the settings through accessors. Nothing changes for a player, and nothing changes about what the config file holds. This is groundwork. It is what lets the tickets that follow change how the save and stats paths are stored without touching a single game module. ## Acceptance criteria - [ ] No caller outside the config module names a `Config` field directly - [ ] The blackjack and poker pay tables are still reachable from the games that read them - [ ] An existing config file reads exactly as it did before, key for key - [ ] No CHANGELOG entry — nothing here is visible to a player ## Blocked by - None — can start immediately.
rosa closed this issue 2026-08-15 19:18:57 +00:00
Sign in to join this conversation.
No description provided.