How nulluo/chirinulluo.mahjong works
Major Components
• Game Core (ChiriNulluo.Mahjong.Core)
• Contains fundamental classes for game management such as MatchManager, RoundManager, Tiles, Hand, Yaku, and various player implementations (Human and COM).
• Represents the core domain model and game logic.
• Extension Modules (ChiriNulluo.Mahjong.Precure)
• Provides extra features or themed versions of game logic (e.g., specialized hand checking, XML configuration for game rules, and constants).
• User Interface (ChiriNulluo.Mahjong.WinFormApplication)
• Implements the graphical user interface using Windows Forms.
• Contains components for displaying game elements: Views, Forms, Controls (tile displays, replay forms, score panels, etc.), and multimedia objects (sounds, images).
• Starter/Launcher (ChiriNulluo.Mahjong.Starter)
• Likely responsible for initializing and starting the game.
• Testing (ChiriNulluo.Mahjong.Test)
• Contains unit tests for the core game logic and extensions.
• Tools (ChiriNulluo.Mahjong.Tools)
• Provides utilities such as release XML creation, tile displays, and probably management tools for debugging or updates.
• Online Updater (ChiriNulluo.OnlineUpdater)
• Manages software update tasks, including download, version comparison, and release notes display.
• Additional small projects (TestProgram, various .asta files) that could serve as demos, test beds, or legacy projects.
Relationships and Data Flow
• The Game Core is the backbone; it provides services to the UI layer.
• The Precure module and its related players, hand checkers, and data access layers extend or modify the core functionality. Illustrate these as a separate module that “plugs into” the game core.
• Tools may interact both with the core (for, say, examining release data or debugging game rules) and with external systems (like build or release management). Represent these interactions accordingly.
Architectural Patterns and Design Principles
• The code is organized into loose modules following separation of concerns.
• Domain logic (players, tiles, game round, yaku) is nicely separated from presentation (views/forms in the WinFormApplication).
• The use of factory methods (e.g., COMPlayerFactory, PrecureCOMHandFactory) and facades (like RoundFacade) indicate common design patterns.
• There is an abstraction for COM player algorithms, hinting at extensibility for AI/COM strategies.
Technologies and Dependencies
• The project is written in Visual Basic (.vbproj files) and uses Windows Forms for UI.
• It utilizes external libraries like NLog for logging—a component present in multiple modules.
• NUnit is used for testing, as evidenced by the NUnit packages.
• XML is used for configuration in various parts (for example, CureJongConfig.xml, NLog.config, UpdateLog.xml).
Elements
• Labels for each major module: “Game Core”, “Precure Module”, “WinForm UI”, “Online Updater”, “Tools”, “Testing”.
• UI interactions with the Facade and Core.
• Data flow from the Core (game state and tile management) to the UI.
• External dependencies such as logging (NLog) and XML configurations.
• Frontend vs. backend.
• Core domain logic vs. supporting tooling.
• In-house modules vs. external system dependencies.
Summary of Steps for the Principal Software Engineer
• On the design patterns: indicate where factories, facades, and abstraction layers exist.
• Clearly label every component and interaction, specifying technology notes (e.g., “Uses NLog for logging”, “XML-driven configuration in Precure modules”).