Skip to content

Add a fishing business: buy a boat and hire a crew#93

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/fishing-business
Jun 13, 2026
Merged

Add a fishing business: buy a boat and hire a crew#93
dmccoystephenson merged 1 commit into
mainfrom
feature/fishing-business

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Implements the top PLANNING.md goals — "open a fishing business" and "hire workers" — adding a passive-production layer so money has a purpose beyond the $10k goal.

  • Player: new persisted hasBoat (bool) and workers (int), added to schemas/player.json and playerJsonReaderWriter with backward-compatible defaults (old saves load fine).
  • src/business/business.py: runDailyProduction(player, stats) — each day every worker catches WORKER_FISH_PER_DAY fish for WORKER_DAILY_WAGE in 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 into TimeService.increaseDay, next to interest.
  • Docks: a "Manage Boat & Crew" option (appended, so existing menu numbers/tests are unchanged) to buy a boat ($%d BOAT_PRICE), hire/dismiss workers (capped at MAX_WORKERS), and view the crew's per-day economics.
  • Docs: removes the two completed PLANNING.md goals; documents the feature in the README.

Design notes

  • A boat is the upfront gate/investment; hiring is free but commits you to daily wages — wages create the ongoing money sink and the "keep cash on hand" tension.
  • Production runs on the day rollover, so it stacks with sleeping/time passing like interest does.

Test plan

  • python3 -m compileall -q src clean
  • SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest — 210 passed
  • New tests: business engine (no-boat no-op, catch+wages, under-funded workers quit, all-quit-when-broke); player defaults; hasBoat/workers round-trip + missing-field defaults; increaseDay runs 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

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 dmccoystephenson left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dmccoystephenson dmccoystephenson merged commit 9d5ad2c into main Jun 13, 2026
1 check passed
@dmccoystephenson dmccoystephenson deleted the feature/fishing-business branch June 13, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant