Add a fishing business: buy a boat and hire a crew#93
Merged
Conversation
Implements the PLANNING.md goals "open a fishing business" and "hire workers", turning accumulated money into ongoing production instead of just a number. - Player gains persisted hasBoat / workers fields (schema + reader/writer, with backward-compatible defaults for old saves). - New src/business module: each new day, every worker brings in a fixed catch for a daily wage; if the player can't cover payroll, the workers they can't pay quit (so a broke, over-hired business shrinks rather than going negative). Wired into TimeService.increaseDay alongside interest. - The docks gain a "Manage Boat & Crew" option (appended, so existing menu numbers are unchanged): buy a boat, hire/dismiss workers, and see the crew's daily economics. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dmccoystephenson
left a comment
Member
Author
There was a problem hiding this comment.
Self-review:
- Scope: PASS — one cohesive feature: Player fields + persistence/schema, src/business engine, TimeService day-hook, docks Manage Boat & Crew UI, docs, tests.
- Schema-sync/save-safety: PASS — hasBoat/workers added optional to schemas/player.json and read with .get defaults; round-trip + missing-field tests confirm old saves load unchanged.
- Tests: PASS — 210; business engine incl. the under-funded/all-quit edge cases, day-rollover production, and docks buy/hire/dismiss/insufficient-funds.
- Regression safety: existing docks menu numbers preserved (option appended); default player makes increaseDay a no-op for the business, so prior TimeService tests hold.
- CI: PASS. Money shown via existing int/%.2f conventions; no unseeded-random tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the top
PLANNING.mdgoals — "open a fishing business" and "hire workers" — adding a passive-production layer so money has a purpose beyond the $10k goal.Player: new persistedhasBoat(bool) andworkers(int), added toschemas/player.jsonandplayerJsonReaderWriterwith backward-compatible defaults (old saves load fine).src/business/business.py:runDailyProduction(player, stats)— each day every worker catchesWORKER_FISH_PER_DAYfish forWORKER_DAILY_WAGEin wages. If the player can't cover payroll, the workers they can't pay quit (a broke, over-hired business shrinks instead of going negative). Hooked intoTimeService.increaseDay, next to interest.$%dBOAT_PRICE), hire/dismiss workers (capped atMAX_WORKERS), and view the crew's per-day economics.PLANNING.mdgoals; documents the feature in the README.Design notes
Test plan
python3 -m compileall -q srccleanSDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest— 210 passedhasBoat/workersround-trip + missing-field defaults;increaseDayruns production; docks buy-boat / insufficient-funds / hire / dismiss / the new run option.Resolves the PLANNING.md "fishing business" + "hire workers" goals.
🤖 Generated with Claude Code