Skip to content

Commit

Permalink
feat(arcade): add log for best score
Browse files Browse the repository at this point in the history
  • Loading branch information
drawbu committed Apr 7, 2024
1 parent 3567903 commit 09f21c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Arcade/Arcade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <ASS/IGame.hpp>
#include <algorithm>
#include <iostream>
#include <memory>

#include "Engine.hpp"
Expand All @@ -34,6 +35,7 @@ int gg::Arcade::run() const
{
gg::Engine engine;
engine.set_renderer(_args.getRenderer());
size_t best_score = 0;

auto username = gg::Menu::get_username(engine);

Expand All @@ -43,7 +45,10 @@ int gg::Arcade::run() const

for (bool running = true; running;) {
auto status = game_instance->run(engine);
// TODO: score
if (status.second > best_score)
std::clog << "New best score for '" << username
<< "': " << best_score << std::endl;

switch (status.first) {
case ass::RunStatus::Exit:
running = false;
Expand Down
2 changes: 0 additions & 2 deletions Arcade/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ gg::Engine::get_shared_objects()
try {
gg::Engine::open_shared_object(path, items);
} catch (const std::exception &e) {
std::cerr << "While loading `" << path << "`: " << e.what()
<< std::endl;
continue;
}
}
Expand Down

0 comments on commit 09f21c7

Please sign in to comment.