How univlille-meta/chess works
Project type and purpose
• This is a Pharo‐based desktop application (a small chess game) that serves as a training playground for software engineering skills.
• It is organized as a set of Smalltalk packages (Core, UI, Importers, Tests) loaded via a Metacello Baseline.
Top-level components (from file tree and README)
• Baseline loader
• src/BaselineOfMygChess/package.st (Metacello baseline definition).
• Domain (Core engine)
• src/Myg-Chess-Core/package.st (Board, Square, Piece classes and move rules).
• Importers
• src/Myg-Chess-Importers/package.st (PGNImporter, FENImporter, parsing logic).
• UI
• Bloc/Toplo‐based UI elements: MyChessGame, square and piece renderers, event loop via BlSpace.
• Tests
• src/Myg-Chess-Tests/package.st (unit tests for Core and Importers).
• Configuration
• src/.properties (package metadata)
• .project (IDE integration)
• LICENSE, README.md
Relationships and interactions
• User → UI layer
• The player invokes MyChessGame freshGame, configures BlSpace, and interacts via mouse/keyboard.
• UI layer → Domain layer
• UI squares dispatch move requests to Board and Piece objects.
• Rendering logic reads Domain state (which pieces occupy which squares).
• Importers → Domain layer
• PGNImporter and FENImporter parse text and instantiate Domain objects (Board, Piece positions).
• Tests → Domain & Importers
• Unit tests exercise Core logic and parsing via Importers.
• Baseline loader → All packages
• Metacello uses the BaselineOfMygChess definition to load Core, UI, Importers, Tests into the Pharo image.
Architectural patterns and design principles
• Layered architecture: Presentation (UI) / Domain (Core) / Integration (Importers) / Tests.
• Composite UI: Board composed of Bloc elements (squares contain child elements).
• Event‐driven loop (BlSpace manages pulses and user events).
• Polymorphic dispatch for piece movement and rendering.
• Separation of concerns: parsing logic isolated in Importers, core rules in Core package, UI decoupled via Bloc/Toplo APIs.