🧹 Maintenance: Consolidate Turn Production Logic into TurnEngine#88
Conversation
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.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR performs significant maintenance on the game's core systems by deduplicating the turn-based production logic.
Changes:
runProductionand related methods fromLocalGameServer.ts. The server now delegates these responsibilities to the sharedTurnEngine.TurnEngine.tsto use focused helper methods for construction costs and resource management, improving maintainability.TurnNotificationEffectinTurnEnginewith the standardGameEffectprotocol fromsrc/shared/game/protocol.ts.LocalGameServer.ts.ProductionSystem.getInventoryCapacityinTurnEngineto 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