Skip to content
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

Fix scores and statistics when game is over #148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
project('2048', 'cpp',
default_options : ['cpp_std=c++14', 'warning_level=2'])
default_options : ['cpp_std=c++17', 'warning_level=2'])

main_target_name = '2048'

sources = ['src/2048.cpp', 'src/gameboard.cpp', 'src/gameboard-graphics.cpp', 'src/game.cpp', 'src/game-input.cpp', 'src/game-graphics.cpp', 'src/game-pregamemenu.cpp', 'src/global.cpp', 'src/loadresource.cpp', 'src/menu.cpp', 'src/menu-graphics.cpp', 'src/saveresource.cpp', 'src/scores.cpp', 'src/scores-graphics.cpp', 'src/statistics.cpp', 'src/statistics-graphics.cpp', 'src/tile.cpp', 'src/tile-graphics.cpp']
hdrs = include_directories('src/headers')

Expand Down
3 changes: 2 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,11 @@ GameBoard endlessGameLoop(ull currentBestScore, competition_mode_t cm,
while (loop_again && ((mainmenustatus[FLAG_START_GAME] == true) || (mainmenustatus[FLAG_CONTINUE_GAME] == true))) {
std::tie(loop_again, currentgamestatus) = soloGameLoop(currentgamestatus);
}
auto properGameboard = std::get<GameBoard>(currentgamestatus);

DrawAlways(std::cout,
DataSuppliment(currentgamestatus, drawEndGameLoopGraphics));
return gb;
return properGameboard;
}

Scoreboard::Score make_finalscore_from_game_session(double duration,
Expand Down