Can now use -g to set a goal.

This commit is contained in:
Zed A. Shaw 2025-04-24 13:00:40 -04:00
parent 3d4ddde96e
commit 210b0e4d21
7 changed files with 40 additions and 13 deletions

View file

@ -93,9 +93,16 @@ void Builder::BUILDING(BuildEvent) {
auto m = parse_line(line);
if(m.match) {
fmt::println("HIT WITH {} @ {}:{}:{} {}", m.type, m.file_name, m.lnumber, m.col, m.message);
std::string hit_line = fmt::format("{} @ {}:{}:{}",
m.type, m.file_name, m.lnumber, m.col);
fmt::println("HIT WITH {} {}", hit_line, m.message);
if(!$hit_line_stats.contains(hit_line)) {
$hit_line_stats.insert_or_assign(hit_line, 1);
game.event(GameEvent::HIT, m.type);
}
game.event(GameEvent::HIT, m.type);
gui.update_status(game, line.size(), true);
} else {
gui.update_status(game, line.size(), false);
@ -180,6 +187,8 @@ void Builder::DONE(BuildEvent) {
gui.you_died();
}
$hit_line_stats.clear();
game.event(GameEvent::BUILD_DONE);
listener->reset_state();
gui.output("^^^^^^^^^^^ END ^^^^^^^^^^^");