-
Notifications
You must be signed in to change notification settings - Fork 0
ref: migrate to mvc pattern #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
move app/ to src/ add controller and new models and views chage assets structure
Need to rewrite level logic and implement a level model and view. And also fix checks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the project to an MVC pattern by moving the app/ directory to src/, introducing new controllers, models, and views, and updating the assets structure.
- Moves application files to a new src/ directory
- Adds new controller, models, and views
- Adjusts resource and asset definitions in CMakeLists.txt
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/model/level.hpp | New model header for level; review header guard naming consistency. |
src/model/level.cpp | Implements level logic; issues observed in tile conversion function. |
src/model/block.hpp & .cpp | New minimal block class added. |
src/CMakeLists.txt | Updated resource definitions; review for duplicate asset entries. |
app/game/* and app/CMakeLists.txt | Removed legacy widget files as part of the MVC migration. |
Comments suppressed due to low confidence (2)
src/model/level.hpp:1
- Header guard 'LEVEL_WIDGET_H_' does not match the file name 'level.hpp'. Consider renaming it to 'LEVEL_HPP_' for consistency.
#ifndef LEVEL_WIDGET_H_
src/model/level.cpp:9
- The include directive uses 'level_widget.h' but the file is named 'level.hpp'. Ensure the include directive matches the actual file name.
#include "level_widget.h"
src/model/level.cpp
Outdated
char block = blocksGrid_[i][j]; | ||
// Coordinates in tilesGrid_ | ||
char x = i*2; | ||
char y = i*2; |
Copilot
AI
May 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug: 'y' is calculated using 'i' instead of 'j'. Verify if this should be 'char y = j*2;' to correctly represent tile coordinates.
char y = i*2; | |
char y = j*2; |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to be rewritten completely/
src/model/level.cpp
Outdated
std::vector<char> tile = tilesGrid_[i][j]; | ||
tilesGrid_[i][j] = tile; |
Copilot
AI
May 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type mismatch: 'tilesGrid_[i][j]' yields a 'char' but is being assigned to a 'std::vector'. Review and correct the conversion logic.
std::vector<char> tile = tilesGrid_[i][j]; | |
tilesGrid_[i][j] = tile; | |
tilesGrid_[x][y] = block; | |
tilesGrid_[x + 1][y] = block; | |
tilesGrid_[x][y + 1] = block; | |
tilesGrid_[x + 1][y + 1] = block; |
Copilot uses AI. Check for mistakes.
rename layouts fix path to sources in cmake fix includes
add cppcheck repair clang-tidy apply some clang-tidy fix
rm 38 line (duplicates line 37) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
move app/ to src/
add controller and new models and views
chage assets structure