How kkar1503/smu-cs102-project works
Main Components
• Main Application Entry Points: Classes such as Main.java and Client.java which are responsible for starting the application.
• Game Engine: Centered on the "parade.engine" package, this includes the AbstractGameEngine, its concrete implementation (LocalGameEngine), and the Lobby that likely manages game sessions.
• Player Module: The "parade.player" package includes the IPlayer interface along with its concrete computer player implementations (EasyComputer, NormalComputer, HardComputer) and the LocalHuman class for human interactions.
• Rendering Module: Found in "parade.renderer", with an interface (IClientRenderer) and implementations (AdvancedClientRenderer, BasicLocalClientRenderer) that handle the user interface aspects of the console game.
• Logging Module: Located under "parade.logger" this module defines an AbstractLogger and provides several implementations (JsonLogger, MultiLogger, NopLogger, PrettyLogger) designed to manage logging outputs.
• Configuration/Settings: The "parade.settings" package contains classes for managing configuration keys and settings important for game behavior.
• Utilities & Resources: Helper classes (ConsoleColors in the utils package) and resource files (e.g., configuration properties, ASCII art) which aid the overall user experience and functionality.
Architectural Patterns and Design Principles
• The project follows a modular architecture where separation of concerns is evident: game logic, player interactions, presentation, and infrastructure (logging and settings) are clearly segregated.
• There is an abstraction-based approach in many packages (engine, logger, renderer) hinting at use of strategies or factories to select concrete implementations (such as choosing between AdvancedClientRenderer and BasicLocalClientRenderer).
• The use of interfaces (e.g., IPlayer, IClientRenderer) promotes flexibility and testability.
• Exception handling is explicitly addressed in the domain layer with custom exceptions, ensuring robust error management.
Technologies and Frameworks
• Java is the primary language.
• Maven is used as build management (indicated by pom.xml).
• Scripts for launching the client and overall game (both Windows and Unix shell scripts) help run the application in different environments.
Elements
• Each major component should have a clear label.
• Use annotations to explain key interactions (for example: "Game Engine uses settings to initialize game parameters" or "Logger gathers events from multiple components").