Open the casino against a home #46
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#45 Give the config module a home to load from
rosa/casino
Reference
rosa/casino#46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 theFilessettled 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
Defaultderive on the casino goes: a casino with nofiles 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
touching the real home
gift
same place the config named
Default, and the config is not cloned toconstruct one
Blocked by