Modern UI live: the events so far while a live matchday stands still

read_live during a pause lists each live match's goals, misses, cards and
injuries so far from the group's log, as the almanac reads it at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-27 13:36:37 +01:00
1 parent 822331f045
commit 7c5030ca4b
3 files changed
+30 -2

No files matched your search

+6
View File
@@ -422,6 +422,12 @@ int main(int argc, char** argv) {
check(s(at(stepped, "messageType")) == "command_result" && at(state, "minute").integer() &&
*at(state, "minute").integer() >= 30, "thirty minutes on");
std::printf("(live state: %s)\n", cli::dump_json(state).substr(0, 400).c_str());
if (const auto* live = at(state, "matches").array(); live && !live->empty()) {
int goals = 0;
for (const auto& e : *at((*live)[0], "events").array()) goals += s(at(e, "kind")) == "goal";
const auto* score = at((*live)[0], "score").array();
check(score && goals == *(*score)[0].integer() + *(*score)[1].integer(), "the live goals match the score");
}
// a substitution: the last field row for the first bench row
const J lineup = session.ui_read(O{{"kind", "lineup"}}, rev);
const auto* order = at(at(lineup, "data"), "order").array();