Feature/start turn1 gui#29
Conversation
…orPlayers i JourneyService för att det ska fungera bra med flera spelare. Ny metod refreshTurnCache() i Controller som använder detta. Den metoden läggs till i syncHudandMap(). Uppdaterad updateHud() med int lastTurn = lastTurnByTravelerId.getOrDefault(current.getId(), 0); currentTurnLabel.setText(String.valueOf(lastTurn + 1));
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR introduces per-traveler turn caching in TravelGameController by adding a map to store last turn numbers. A new Changes
Sequence DiagramsequenceDiagram
participant UI as UI/Event
participant Controller as TravelGameController
participant Cache as lastTurnByTravelerId
participant Service as JourneyService
participant DB as Database
UI->>Controller: syncHudAndMap()
Controller->>Controller: refreshTurnCache()
Controller->>Service: getLastTurnNumbersForPlayers(travelerIds)
Service->>DB: Query MAX(turnNumber) per traveler
DB-->>Service: Turn data
Service-->>Controller: Map<Long, Integer>
Controller->>Cache: Store results
Controller->>UI: Update currentTurnLabel from cache
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.