-
Notifications
You must be signed in to change notification settings - Fork 324
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
Document functions, add features: 'return to menu', 'remove tiles' #145
Conversation
BurhanHTW
commented
Jun 19, 2024
- Implemented 'Return to Menu' functionality.
- Added 'Remove Tiles' feature.
- Unified saving game state and statistics into a single file.
- Enabled selection of saved game states for continuation.
- Implemented 'Return to Menu' functionality. - Added 'Remove Tiles' feature. - Unified saving game state and statistics into a single file. - Enabled selection of saved game states for continuation.
We have submitted the pull request, and it has been a pleasure to contribute to this project. |
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.
Code looks good, thank you very much! :)
I can see that a CI workflow is failing. Could you check the error behind it? Ideally, we want these checks to be successful before trusting it to be merged.
Additionally, a couple of changes I'd love to see before merging it:
- Let's remove the
.vscode
directory. More details in the review comments. - Let's be uniform with how we do in-line comments. Gives much better readability.
- The added code would benefit from being run against a formater/linter. This will format the code to make it uniform. We've got a
.clang-format
file that specifies the formatting conventions used in this project.
Nevertheless, I'm approving this PR on the basis of the solid feature code additions -- they look great!
@@ -0,0 +1,18 @@ | |||
{ |
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.
Let's remove the .vscode
files. They're meant for developer-specific configs on local machines, so shouldn't be part of the repository.
Bonus: Add the .vscode
folder to the .gitignore
file. This should prevent it from being staged and committed in the future as well! :)
@@ -0,0 +1,24 @@ | |||
{ |
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.
Same with this file... let's remove it.
@@ -0,0 +1,114 @@ | |||
{ |
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.
...and this one too
* @note The new addition includes 'M' for returning to the menu. | ||
* | ||
* @return std::string A formatted string containing the list of input commands. | ||
*/ |
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.
Comments look great, thank you!
* The commands include movements (Up, Left, Down, Right), saving the game, and returning to the menu. | ||
* The prompt is formatted with indentation for readability. | ||
* | ||
* @note The new addition includes 'M' for returning to the menu. |
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.
We can remove this note, since it will get outdated pretty quickly.
@@ -135,7 +149,7 @@ bool canMoveOnGameboardDataArray(gameboard_data_array_t gbda) { | |||
const auto offset_check = { | |||
current_point + offset, // Positive adjacent check | |||
current_point - offset}; // Negative adjacent Check | |||
for (const auto current_offset : offset_check) { | |||
for (const auto ¤t_offset : offset_check) { //auto REFERENCE current_offset |
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.
commented out code 👀
|
||
while (std::getline(stateFile, tempLine)) { | ||
if (tempLine.find('[') != std::string::npos) { | ||
break; // Exit loop if '[' is found |
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.
Great idea here, as well as the -1
to return an error!
@@ -81,7 +128,7 @@ get_and_process_game_stats_string_data(std::istream &stats_file) { | |||
if (stats_file) { | |||
unsigned long long score; | |||
long long moveCount; | |||
for (std::string tempLine; std::getline(stats_file, tempLine);) { | |||
for (std::string tempLine; std::getline(stats_file, tempLine, '.');) { |
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.
Why was the '.'
required?
src/menu.cpp
Outdated
mainmenustatus[FLAG_START_MENU] = true; // Initial state is Menu | ||
if (mainmenustatus[FLAG_START_MENU] == true) // If the menu flag is set, we enter... | ||
{ | ||
soloLoop(); // ... the soloLoop() function, where we navigate the menu |
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.
Let's move these comments to the line above.
@@ -56,7 +56,7 @@ std::string ScoreboardOverlay(scoreboard_display_data_list_t sbddl) { | |||
<< "\n"; | |||
}; | |||
|
|||
for (const auto s : sbddl) { | |||
for (const auto& s : sbddl) { // auto REFERENCE s |
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.
commented out code 👀
We‘ll try to fix the CI. Hopefully this solved asap :) |
I have to switch from C++14 to C++17 in CMakeLists.txt #include in menu.cpp is only supported from C++17 onwards. https://en.cppreference.com/w/cpp/filesystem |
Have you tried fixing the issue using the suggestion in the error message? |
Not yet. But it should fixed by changing C14 to C17. |
@BurhanHTW could you push the changes to your branch to re-trigger the CI? |
I will Push it later when i am at home. We have changed everything what you wanted :) |
I cant push anything because the access is denied |
I had to generate a new Token to push. Now we are waiting for the workflow approval. You can see our next commit as i can see |
@BurhanHTW your latest commit has many merge conflicts present. Example Remove all merge markers - they're causing the builds to fail. |
hopefully done :D |
I don’t know what i have Done actually i have to Check the Problems … |
I have to many Problems Right now i try to solve them. |
If i have to many Problems. Is it possible to make a new pull Request? I guess i had to many Problems because i commited to many files |
If the workflow fails again i‘ll create a new Pull Request and Push the latest Code again. I am sorry to have those issues. :/ |
So the workflow failed again. I will create a new pull Request. |
Yep, that sounds like a good idea!
… On 24-Jun-2024, at 11:17, BurhanHTW ***@***.***> wrote:
So the workflow failed again. I will create a new pull Request.
—
Reply to this email directly, view it on GitHub <#145 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHTCX66PS62KPHAKA7IGWULZI6XGBAVCNFSM6AAAAABJSMEXOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBVGY3DANBZGI>.
You are receiving this because you commented.
|
I have closed this pull request. I will create a new one now. |