Skip to content

🧹 Maintenance: Consolidate Turn Production Logic into TurnEngine#88

Merged
b0x1 merged 1 commit into
mainfrom
refactor-turn-engine-deduplication-14794999002233000980
May 8, 2026
Merged

🧹 Maintenance: Consolidate Turn Production Logic into TurnEngine#88
b0x1 merged 1 commit into
mainfrom
refactor-turn-engine-deduplication-14794999002233000980

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This PR performs significant maintenance on the game's core systems by deduplicating the turn-based production logic.

Changes:

  1. Deduplication: Removed the redundant implementation of runProduction and related methods from LocalGameServer.ts. The server now delegates these responsibilities to the shared TurnEngine.
  2. Complexity Reduction: Refactored TurnEngine.ts to use focused helper methods for construction costs and resource management, improving maintainability.
  3. Type Consistency: Replaced internal TurnNotificationEffect in TurnEngine with the standard GameEffect protocol from src/shared/game/protocol.ts.
  4. Dead Code Removal: Cleaned up unused imports and variables identified by ESLint in LocalGameServer.ts.
  5. Logic Consolidation: Used ProductionSystem.getInventoryCapacity in TurnEngine to standardize how inventory limits are calculated.

These changes ensure that the game's authoritative state transitions are handled consistently by a single engine, reducing the risk of desynchronization bugs between the client and server.


PR created automatically by Jules for task 14794999002233000980 started by @b0x1

Consolidated redundant production logic from LocalGameServer into the
centralized TurnEngine system. This eliminates over 250 lines of
duplicated code and ensures a single source of truth for the game loop
across client-side simulation and authoritative server logic.

Key changes:
- Migrated construction helper methods to TurnEngine for better decomposition.
- Updated TurnEngine to use the shared GameEffect protocol for notifications.
- Removed dead code and unused imports from LocalGameServer.
- Verified consistency with ProductionSystem.getInventoryCapacity.
- All tests and lint checks passed.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@b0x1 b0x1 merged commit 399cada into main May 8, 2026
5 checks passed
@b0x1 b0x1 deleted the refactor-turn-engine-deduplication-14794999002233000980 branch May 8, 2026 15:37
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