Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe changes introduce multi-state menu support, add a new static mode setting, and implement mode-specific end conditions for sprint and blitz game modes. The menu system is refactored for dynamic options and improved UI. The main function now supports selecting between sprint, blitz, and zen modes, with submenus for detailed mode selection. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Menu
participant Settings
participant Game
User->>Menu: display(0) // Main menu
Menu-->>User: Show options (Sprint, Blitz, Zen, etc.)
User->>Menu: Selects mode (e.g., Sprint)
Menu-->>User: Show Sprint submenu
User->>Menu: Selects variant (e.g., Sprint 40L)
Menu->>Settings: setMode("sprint_40l")
User->>Game: Initialize and run
Game->>Settings: getMode()
Game-->>User: Runs game loop
alt Sprint mode
Game->>User: Ends game when lines cleared >= target
else Blitz mode
Game->>User: Ends game when time limit reached
else Zen mode
Game->>User: Runs until user exits
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This pull request introduces significant changes to the game's menu system, game modes, and settings management. It adds support for new game modes (Sprint, Blitz, Zen) with sub-menu navigation, integrates mode-specific logic into the game flow, and refactors the
Menuclass for dynamic rendering. Additionally, it enhances theSettingsclass to manage game modes and updates theGameclass to handle mode-specific conditions.Menu System Enhancements:
Menu::displayto support dynamic rendering based on the current menu state, including sub-menus for Sprint and Blitz modes. Added visual improvements like titles, separators, and error handling for invalid choices. (include/Menu.h[1]src/Menu.cpp[2]main.cppto integrate sub-menu navigation for Sprint and Blitz modes, allowing users to select specific challenges (e.g., 20L Sprint, 1:00 Blitz). (src/main.cppsrc/main.cppL49-R126)Game Modes Integration:
Game::processLineClearto handle Sprint mode completion based on the number of cleared lines (20, 40, or 100). (src/Game.cppsrc/Game.cppR323-L328)Game::update, ending the game when the time limit is reached (1:00, 2:00, or 4:00). (src/Game.cppsrc/Game.cppR389-R408)Settings Management:
Settingsclass to include amodeproperty with getter and setter methods, enabling dynamic mode management. Default mode set to "zen". (include/Settings.h[1]src/Settings.cpp[2]Code Cleanup:
Game::runfor improved readability and consistency. (src/Game.cppsrc/Game.cppL79-R90)Game::processLineClearfor better clarity and maintainability. (src/Game.cppsrc/Game.cppR296-L298)Summary by CodeRabbit
New Features
Improvements