How pslusarz/gnubridge works
Major Components
a. Core Game Engine:
• Includes domain classes like Card, Deal, Hand, Trick, and Direction.
• This is the foundation for representing and processing the state of a Bridge game.
b. Bidding Logic:
• Contains bidding-related classes (e.g., Auctioneer, BiddingAgent, Bid, Call, Pass, Redouble) along with a rich set of bidding rules (found under org.gnubridge.core.bidding/rules).
• It handles all the decision-making and scoring during the bidding phase.
c. Deck & Card Components:
• Represented by classes in the deck package that define card suits, ranks, and trump logic.
d. Presentation / GUI Layer:
• Provided in the presentation package, this layer includes classes for managing the graphical display of cards, bidding interfaces, deal views, and overall game interaction (e.g., MainView, BiddingDisplay, CardPanel).
e. Search / AI Engine:
• Found within the search package, it includes the DoubleDummySolver, alpha-beta pruning (see classes like AlphaBeta, PruningStrategy), and supporting algorithms that analyze bridge positions.
f. Data & Resources:
• The data folder contains supplementary files and assets (like images for cards and papers for reference/documentation).
g. Testing Suite:
• Comprehensive test packages that validate core functionality for game logic, bidding, GUI, and search algorithms.
Out the Component Relationships
• The GUI (Presentation Layer) interacts with the underlying controllers (e.g., MainController, BiddingController, DealController) to send user inputs.
• These controllers, in turn, direct calls to the core game engine and bidding logic to update game state.
• The core engine components (from org.gnubridge.core) use classes from the deck and bidding packages to simulate gameplay.
• The Search / AI component (DoubleDummySolver and related classes) analyzes game state to advise moves or calculate outcomes, interfacing directly with the core game state.
• Configuration and resource files (including Gradle scripts) support build deployment and resource loading for both the GUI and game logic.
Architectural Patterns and Design Principles
• Separation of Concerns: Notice the clear separation between the game logic (core, bidding, search) and the presentation (GUI) layers.
• Modular Design: Each folder/package encapsulates a distinct aspect of the game, from core representations to AI search algorithms.
• MVC-like Pattern in Presentation: Although not explicitly documented, the usage of Controllers (e.g., MainController, DealController) alongside distinct View implementations suggests a Model-View-Controller separation.
• Testing: Extensive test cases are organized by the same functional areas, ensuring that each component behaves as expected.
Relevant Technologies and Frameworks
• Java (minimum version 1.5).
• Gradle (with the gradlew wrapper provided).
• The project might use specific libraries for GUI rendering (e.g., Swing or AWT) as indicated by the package naming in the presentation layer.