How oscat725/projetpirate_groupe2 works
1. This is a Java desktop game project, likely built with NetBeans and Swing. The source of truth is under src/main/java; the build, dist, and bin trees are generated artifacts and older copies that should not drive the architecture diagram.
2. The code is organized around a layered, MVC-like split with French naming:
- presentation and console are user-facing entry points.
- controleur contains application logic and orchestration.
- entity contains the game model.
- interface_noyau_fonctionnel and noyau_fonctionnel form an abstraction/adapter boundary between the UI layer and the core game logic.
3. The main runtime entry point appears to be onepiece.projetpirate.ProjetPirate. From there, the app can launch either the graphical UI or the console-oriented boundary classes.
4. The graphical frontend is in presentation and is Swing-based, as shown by the .form files (MainFrame.form, PanelCase.form). The visible UI is composed of MainFrame, PanelPlateau, PanelCase, and PanelDe, which together likely render the board, board cells, and dice.
5. There is also a console-facing path in console with BoundaryCommencerPartie and BoundaryLancerDe. This suggests the same game engine can be driven through a text-based interface, with the UI layer swapped without changing the core domain.
6. The controller layer coordinates game actions and state transitions. The main controllers are:
- ControlCommencerPartie for game setup,
- ControlDeplacer for moving the pirate token,
- ControleurDe / ControlCacherDe for die handling,
- ControlActiverCaseCoco for special board-case behavior,
- ControlPointDeVie and ControlVerifierFinPartie for health/endgame logic,
- ControlJeuPirate as the broader game coordinator.
7. The model is centered on board-game entities in entity:
- Jeu is the aggregate root for a match,
- Plateau represents the board,
- Joueur and Pion represent players and pieces,
- De is the die,
- Case is the base board cell type,
- CaseBombe, CaseCoco, and CaseMystere are specialized cell behaviors,
- Couleur is likely an enum used for player identity or UI styling.
8. The architecture suggests state flows from UI to controller to entity model, then back to the UI. User actions such as starting a game, rolling dice, or moving a piece are handled by the controller layer, which mutates the model and then updates presentation components.
9. interface_noyau_fonctionnel defines the public contracts (INoyauFonctionnel, IPirates) that insulate the rest of the app from implementation details. noyau_fonctionnel.AdaptateurNoyauFonctionel likely implements that bridge, translating UI/controller requests into core game operations.
10. boundary and frontiere appear to be overlapping or legacy naming for boundary-layer classes/interfaces. For diagramming, the important distinction is not the package name but the role: these classes sit at the edge of the application and mediate between user interaction and the game engine.
11. There are no visible external services, databases, or network dependencies. The system appears self-contained: a local, stateful game application with in-memory domain objects and a Swing/console presentation layer.
12. A good architecture diagram should emphasize three major zones: presentation/boundary, controller/adapter, and domain model. The central data path is UI event -> controller -> Jeu/Plateau/Joueur/Case -> updated UI state, with the interface packages acting as the seam between layers.
Main entry points: AdaptateurNoyauFonctionel.java Adapter · Jeu.java Jeu · ControlJeuPirate.java GameCtrl · MainFrame.java MainFrame
Components 25
Runtime
Application entry point and launch path
- ProjetPirate · Application bootstrap and launch selection
ProjetPirate/src/main/java/onepiece/projetpirate/ProjetPirate.java
Presentation
Swing and console user-facing boundaries
- MainFrame · Main graphical window
ProjetPirate/src/main/java/presentation/MainFrame.java - PanelPlateau · Board rendering and layout
ProjetPirate/src/main/java/presentation/PanelPlateau.java - PanelCase · Single board-cell view
ProjetPirate/src/main/java/presentation/PanelCase.java - PanelDe · Dice display and interaction
ProjetPirate/src/main/java/presentation/PanelDe.java - BoundaryStart · Text-mode game start boundary
ProjetPirate/src/main/java/console/BoundaryCommencerPartie.java - BoundaryDice · Text-mode dice boundary
ProjetPirate/src/main/java/console/BoundaryLancerDe.java
Controller
Application coordination and game actions
- StartGame · Initial game setup orchestration
ProjetPirate/src/main/java/controleur/ControlCommencerPartie.java - MovePirate · Piece movement and turn action
ProjetPirate/src/main/java/controleur/ControlDeplacer.java - DiceCtrl · Dice roll coordination
ProjetPirate/src/main/java/controleur/ControleurDe.java - HideDice · Dice visibility/state handling
ProjetPirate/src/main/java/controleur/ControlCacherDe.java - CocoCase · Special coconut-case behavior
ProjetPirate/src/main/java/controleur/ControlActiverCaseCoco.java - Health · Life-point management
ProjetPirate/src/main/java/controleur/ControlPointDeVie.java - EndCheck · End-of-game verification
ProjetPirate/src/main/java/controleur/ControlVerifierFinPartie.java - GameCtrl · Top-level game coordinator
ProjetPirate/src/main/java/controleur/ControlJeuPirate.java
Core seam
Interface contracts and adapter between UI and game logic
- INoyau · Functional-core contract
ProjetPirate/src/main/java/interface_noyau_fonctionnel/INoyauFonctionnel.java - IPirates · Game-facing interface contract
ProjetPirate/src/main/java/interface_noyau_fonctionnel/IPirates.java - Adapter · Bridges UI/controller calls into core game operations
ProjetPirate/src/main/java/noyau_fonctionnel/AdaptateurNoyauFonctionel.java
Domain
Game state and board entities
- Jeu · Match state and orchestration root
ProjetPirate/src/main/java/entity/Jeu.java - Plateau · Board and board-state model
ProjetPirate/src/main/java/entity/Plateau.java - Joueur · Player state
ProjetPirate/src/main/java/entity/Joueur.java - Pion · Movable pirate token
ProjetPirate/src/main/java/entity/Pion.java - Case · Base board-cell type
ProjetPirate/src/main/java/entity/Case.java - Special cases · Bomb, coconut, and mystery cell behavior
ProjetPirate/src/main/java/entity/CaseBombe.java - De · Dice state and value
ProjetPirate/src/main/java/entity/De.java
Connections 28
- ProjetPirate → MainFrame: launches UI · Starts the graphical application path
- ProjetPirate → BoundaryStart: launches console · Starts the text boundary path
- MainFrame → PanelPlateau: contains · Main window embeds the board view
- MainFrame → PanelDe: contains · Main window embeds dice UI
- PanelPlateau → PanelCase: renders · Board view is composed of cell panels
- BoundaryStart → Adapter: calls core · Console boundary delegates into the adapter
- BoundaryDice → Adapter: calls core · Dice boundary delegates into the adapter
- MainFrame → Adapter: uses · Graphical UI talks to the core through the adapter
- GameCtrl → StartGame: orchestrates · Top-level controller coordinates setup
- GameCtrl → MovePirate: orchestrates · Top-level controller coordinates movement
- GameCtrl → DiceCtrl: orchestrates · Top-level controller coordinates dice flow
- GameCtrl → EndCheck: orchestrates · Top-level controller coordinates end checks
- MovePirate → Jeu: mutates · Movement updates match state
- DiceCtrl → De: updates · Dice controller changes die state
- CocoCase → Case: evaluates · Special-case logic acts on board cells
- Health → Joueur: updates · Health logic adjusts player state
- EndCheck → Jeu: checks · End-game logic inspects match state
- Adapter → INoyau: implements · Adapter fulfills the core contract
- Adapter → IPirates: implements · Adapter exposes the game-facing contract
- Adapter → GameCtrl: delegates · Adapter routes requests to the game controller
- Adapter → Jeu: drives · Adapter ultimately operates on the match model
- Jeu → Plateau: owns · Match contains the board
- Jeu → Joueur: tracks · Match tracks players
- Jeu → De: uses · Match includes dice state
- Jeu → Pion: tracks · Match tracks the pirate token
- Plateau → Case: contains · Board is made of cells
- Case → Special cases: specializes · Specialized cell behaviors extend the base cell model
- Pion → Case: moves on · Piece advances across board cells