docs: align class diagram with source types#42
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds/updates the PlantUML class diagram to introduce a CombatStats builder, extended status-effect APIs, a BattleEventPublisher rewiring of engine event flow, scenario/setup factories and a CLI demo, and a Swing-based arena rendering stack with UI state/config and controller extensions. Changes
Sequence Diagram(s)sequenceDiagram
actor Player
participant BattleEngine
participant BattleEventPublisher
participant ArenaSceneModel
participant SwingThread
participant ArenaSceneRenderer
Player->>BattleEngine: performAction(command)
BattleEngine->>BattleEventPublisher: emit(battleEvent, optionalListener)
BattleEventPublisher->>BattleEventPublisher: store(event)
BattleEventPublisher->>ArenaSceneModel: deliver(event)
ArenaSceneModel->>ArenaSceneModel: update state / sprites
SwingThread->>ArenaSceneRenderer: run render(model, now)
ArenaSceneRenderer->>ArenaSceneModel: spritesByDrawOrder()/floatingTexts()
ArenaSceneRenderer->>SwingThread: paint to panel
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/uml-diagrams/plantuml_class_diagram.puml`:
- Around line 877-880: The PostGameConfig interface in the PlantUML diagram is
missing the common accessor; add the method declaration "GameConfiguration
getGameConfiguration()" to the PostGameConfig interface block so the diagram
matches the Java interface (PostGameConfig) and shows the shared contract
implemented by the preset(...) and custom(...) record variants.
- Around line 120-127: Update the PlantUML class diagram so the
CombatStats.Builder setter signatures use Stat instead of int: change the method
declarations in class CombatStatsBuilder (the attack(...), defense(...), and
speed(...) methods) to take a Stat parameter (e.g., attack(attack: Stat):
CombatStats.Builder, defense(defense: Stat): CombatStats.Builder, speed(speed:
Stat): CombatStats.Builder) to match the actual method signatures in CombatStats
(and leave build(): CombatStats as-is).
- Around line 704-710: Update the UML for ArenaSceneModel to match the actual
Java class: replace the outdated fields and methods (remove sprites, enemyOrder,
battleActive, startBattle(...), showPlayerTurn(...)) and instead document the
real members used in src: fields fighters, battleHistory, selectedEnemyId,
gameOver and the method onBattleSetup(BattleSetup setup); ensure visibility and
types match the Java class declarations (e.g., fighters: Map<CombatantId,
FighterSpriteDto>, battleHistory: List<...> etc.) so the PlantUML class block
for ArenaSceneModel reflects those exact symbols.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3fa8acbc-855d-45b9-a0db-3725c80d0748
⛔ Files ignored due to path filters (2)
docs/uml-diagrams/imgs/plantuml_class_diagram.pngis excluded by!**/*.pngdocs/uml-diagrams/imgs/plantuml_class_diagram.svgis excluded by!**/*.svg
📒 Files selected for processing (1)
docs/uml-diagrams/plantuml_class_diagram.puml
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/uml-diagrams/plantuml_class_diagram.puml (1)
124-126:⚠️ Potential issue | 🟠 MajorUse
Statin the builder setters.These signatures still take
int, but the builder state isStat-typed andCombatStatsis composed ofStatvalues insrc/main/java/sc2002/turnbased/domain/CombatStats.java:1-36. That leaves the diagram out of sync with the documented API.Suggested doc fix
class CombatStatsBuilder as "CombatStats.Builder" <<factory>> { - attack: Stat - defense: Stat - speed: Stat - + attack(attack: int): CombatStats.Builder - + defense(defense: int): CombatStats.Builder - + speed(speed: int): CombatStats.Builder + + attack(attack: Stat): CombatStats.Builder + + defense(defense: Stat): CombatStats.Builder + + speed(speed: Stat): CombatStats.Builder + build(): CombatStats }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/uml-diagrams/plantuml_class_diagram.puml` around lines 124 - 126, The PlantUML diagram's builder method signatures are incorrect: update the three builder setters attack(...), defense(...), and speed(...) on CombatStats.Builder to accept Stat (not int) to match the domain model; ensure the diagram shows CombatStats composed of Stat and that CombatStats.Builder::attack, CombatStats.Builder::defense, and CombatStats.Builder::speed use Stat-typed parameters consistent with src/main/java/sc2002/turnbased/domain/CombatStats.java and its Stat fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/uml-diagrams/plantuml_class_diagram.puml`:
- Around line 989-994: The PlantUML arrows are reversed: instead of
EasyLevelSetup, MediumLevelSetup, and HardLevelSetup depending on
BattleSetupFactory and GameConfiguration, the diagram should show
BattleSetupFactory and GameConfiguration depending on those setup helpers (they
are leaf factories). Update the relationships so BattleSetupFactory ..>
EasyLevelSetup, BattleSetupFactory ..> MediumLevelSetup, BattleSetupFactory ..>
HardLevelSetup and likewise GameConfiguration ..> EasyLevelSetup,
GameConfiguration ..> MediumLevelSetup, GameConfiguration ..> HardLevelSetup to
reflect the actual APIs (referencing EasyLevelSetup, MediumLevelSetup,
HardLevelSetup, BattleSetupFactory, and GameConfiguration).
---
Duplicate comments:
In `@docs/uml-diagrams/plantuml_class_diagram.puml`:
- Around line 124-126: The PlantUML diagram's builder method signatures are
incorrect: update the three builder setters attack(...), defense(...), and
speed(...) on CombatStats.Builder to accept Stat (not int) to match the domain
model; ensure the diagram shows CombatStats composed of Stat and that
CombatStats.Builder::attack, CombatStats.Builder::defense, and
CombatStats.Builder::speed use Stat-typed parameters consistent with
src/main/java/sc2002/turnbased/domain/CombatStats.java and its Stat fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 05cc5c68-4813-42b8-a9bc-ee5692fe4e64
⛔ Files ignored due to path filters (2)
docs/uml-diagrams/imgs/plantuml_class_diagram.pngis excluded by!**/*.pngdocs/uml-diagrams/imgs/plantuml_class_diagram.svgis excluded by!**/*.svg
📒 Files selected for processing (1)
docs/uml-diagrams/plantuml_class_diagram.puml
Super clean class diagram!!!!