Skip to content

Conversation

NikitosKey
Copy link
Owner

move app/ to src/
add controller and new models and views
chage assets structure

move app/ to src/
add controller and new models and views
chage assets structure
@NikitosKey NikitosKey linked an issue May 29, 2025 that may be closed by this pull request
@NikitosKey
Copy link
Owner Author

NikitosKey commented May 29, 2025

Need to rewrite level logic and implement a level model and view. And also fix checks.

@NikitosKey NikitosKey requested a review from Copilot May 29, 2025 14:03
Copy link

@Copilot Copilot AI left a 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"

char block = blocksGrid_[i][j];
// Coordinates in tilesGrid_
char x = i*2;
char y = i*2;
Copy link

Copilot AI May 29, 2025

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.

Suggested change
char y = i*2;
char y = j*2;

Copilot uses AI. Check for mistakes.

Copy link
Owner Author

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/

Comment on lines 64 to 65
std::vector<char> tile = tilesGrid_[i][j];
tilesGrid_[i][j] = tile;
Copy link

Copilot AI May 29, 2025

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.

Suggested change
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.

NikitosKey and others added 3 commits May 29, 2025 17:37
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>
@NikitosKey NikitosKey added this to the Alpha milestone May 30, 2025
@NikitosKey NikitosKey self-assigned this May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MVC architecture.

1 participant