How sabinelenny/projetpirates works
1. Overall shape
- This is a small Java/Maven game project centered on a pirate board game.
- The code is organized in a clear layered style: presentation boundaries → controllers → domain entities.
2. Presentation layer
- Boundaries/BoundarieIHM.java and Boundaries/BoundariesJeuTextuel.java define the two user-facing entry points/boundaries.
- The repository therefore supports at least two interaction modes:
- a graphical UI,
- a text-based UI.
3. Graphical UI subsystem
- The IHM package contains Swing-based UI pieces:
- frame3.java and frame3.form indicate a GUI form built with a visual designer,
- BackgroundPanel.java is a custom Swing component for display styling.
- The README’s TODO list confirms the GUI is still evolving: dice animation, pawn design, life bar, special-case animations, and movement visuals.
4. Controller layer
- The Controleurs package is the main application logic boundary between UI and model.
- It contains one controller per gameplay concern:
- ControlJeuPirate likely coordinates the overall game flow,
- ControlPlateau manages the board,
- ControlPirate manages pirate/player state,
- ControlDéplacer handles movement,
- ControlLancerDeDes handles dice rolls,
- ControlFinJeu handles end-of-game detection,
- ControlVerifierVie and ControlVerifierPoison handle status checks,
- ControlCase* classes handle special board cases such as bomb, poison, exchange, and healing.
5. Domain/model layer
- The Entite package contains the core game state:
- Pirate.java represents a player/pawn,
- Plateau.java represents the game board,
- TypeCase.java likely enumerates or classifies square types.
- These classes appear to be the stable game model manipulated by the controllers.
6. Gameplay mechanics implied by the structure
- The board game seems to include:
- movement determined by dice rolls,
- special squares with effects,
- status effects like poison and life changes,
- a win/end condition.
- The separate ControlCaseBombe, ControlCasePoison, ControlCaseEchange, and ControlCaseSoin classes suggest each square type has its own behavior path.
7. Data flow
- User actions originate in either the GUI or text interface.
- Those actions are passed to controllers, which:
- query/update Pirate and Plateau,
- apply square effects,
- verify poison/life/end conditions,
- then return updated state for the UI to render or print.
- The UI itself does not appear to own game rules; it mainly triggers and displays them.
8. Separation boundaries
- The Boundaries package is the architectural seam: it isolates presentation concerns from game logic.
- The Controleurs package is the orchestration seam: it isolates high-level game operations from entity state.
- This makes the project closer to an MVC-style structure than a monolithic UI app.
9. Build/runtime
- The project is Maven-based (pom.xml) and compiles to a runnable JAR in target/.
- The presence of target/classes and ProjetPirates-1.0-SNAPSHOT.jar indicates a standard Java desktop application build, not a service deployment.
10. Test/documentation assets
- The Documentation folder contains test cases, requirements, and coverage materials.
- That suggests the project is being developed with explicit functional validation around special-case behaviors, especially exchange and poison cases.
11. What to emphasize in an architecture diagram
- Show two presentation entry points feeding the same controller layer.
- Show controllers split by gameplay responsibility rather than by UI screen.
- Show Pirate, Plateau, and TypeCase as the core shared domain model.
- Highlight special-case controllers as rule handlers attached to board squares.
12. Key architectural takeaway
- The codebase is a layered, game-rule-driven Java application where the UI is replaceable, the controllers centralize game flow, and the entity layer holds the persistent game state.
Main entry points: ControlJeuPirate.java Game flow · Pirate.java Pirate · TypeCase.java Case type · ControlCase.java Case rules
Components 21
Presentation
User-facing entry points and Swing UI pieces
- GUI boundary · Graphical entry point that connects the Swing UI to game logic
Code/src/main/java/Boundaries/BoundarieIHM.java - Text boundary · Console/text entry point for playing the game
Code/src/main/java/Boundaries/BoundariesJeuTextuel.java - Game window · Designer-built main GUI frame for the pirate game
Code/src/main/java/IHM/frame3.java - Background panel · Custom panel used for visual styling in the GUI
Code/src/main/java/IHM/BackgroundPanel.java
Controllers
Game flow and rule orchestration
- Game flow · Top-level controller coordinating the main gameplay loop
Code/src/main/java/Controleurs/ControlJeuPirate.java - Board control · Manages the board state and board-level operations
Code/src/main/java/Controleurs/ControlPlateau.java - Pirate control · Manages pirate/player state and updates
Code/src/main/java/Controleurs/ControlPirate.java - Move control · Handles pawn movement across the board
Code/src/main/java/Controleurs/ControlDéplacer.java - Dice control · Handles dice rolls and movement randomization
Code/src/main/java/Controleurs/ControlLancerDeDes.java - End control · Detects victory and game termination conditions
Code/src/main/java/Controleurs/ControlFinJeu.java - Life check · Checks whether a pirate still has life remaining
Code/src/main/java/Controleurs/ControlVerifierVie.java - Poison check · Checks and tracks poison status effects
Code/src/main/java/Controleurs/ControlVerifierPoison.java - Case rules · Common base for special-square behavior
Code/src/main/java/Controleurs/ControlCase.java - Bomb case · Applies bomb-square effects
Code/src/main/java/Controleurs/ControlCaseBombe.java - Poison case · Applies poison-square effects
Code/src/main/java/Controleurs/ControlCasePoison.java - Exchange case · Applies pirate exchange-square effects
Code/src/main/java/Controleurs/ControlCaseEchange.java - Heal case · Applies healing-square effects
Code/src/main/java/Controleurs/ControlCaseSoin.java
Domain
Core board-game state and types
Build
Maven packaging and runtime output
- Maven build · Project build and packaging definition
Code/pom.xml
Connections 29
- GUI boundary → Game flow: start game · GUI actions enter the shared game controller
- Text boundary → Game flow: start game · Text actions enter the shared game controller
- GUI boundary → Game window: renders · GUI boundary uses the main Swing frame
- GUI boundary → Background panel: uses · GUI boundary relies on custom Swing styling
- Game flow → Board control: coordinates · Main flow delegates board operations
- Game flow → Pirate control: coordinates · Main flow delegates pirate state updates
- Game flow → Move control: drives · Main flow triggers movement handling
- Game flow → Dice control: drives · Main flow triggers dice rolls
- Game flow → End control: checks · Main flow checks for game end
- Game flow → Life check: checks · Main flow checks life status
- Game flow → Poison check: checks · Main flow checks poison status
- Board control → Plateau: reads/writes · Board controller manipulates the board entity
- Pirate control → Pirate: reads/writes · Pirate controller manipulates player state
- Move control → Pirate: updates · Movement changes pirate position
- Move control → Plateau: queries · Movement depends on the board layout
- Dice control → Pirate: affects · Dice results determine pirate movement
- End control → Pirate: evaluates · End-game logic inspects player state
- Life check → Pirate: evaluates · Life checks inspect pirate health
- Poison check → Pirate: evaluates · Poison checks inspect pirate status
- Case rules → Bomb case: specializes · Base case behavior is refined by bomb rules
- Case rules → Poison case: specializes · Base case behavior is refined by poison rules
- Case rules → Exchange case: specializes · Base case behavior is refined by exchange rules
- Case rules → Heal case: specializes · Base case behavior is refined by healing rules
- Bomb case → Case type: uses · Bomb logic is tied to square types
- Poison case → Case type: uses · Poison logic is tied to square types
- Exchange case → Case type: uses · Exchange logic is tied to square types
- Heal case → Case type: uses · Healing logic is tied to square types
- Plateau → Case type: classifies · The board contains typed squares
- Maven build → GUI boundary: builds · Maven builds the application sources