Modern UI contract: nations, crests, photos, employments, allowed commands
TeamRef carries the world's nation and crest asset key, squad rows the player's photo key. The manager's employments come from the almanac (clubs and national team side by side), the desk's allowed commands follow the desk kind. modern_world_info reports the asset coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
055b48697e
commit
6570384642
8 files changed
+102
-5
No files matched your search
@@ -769,6 +769,17 @@ int main(int argc, char** argv) {
|
||||
std::printf("(journal test skipped: national desk)\n");
|
||||
}
|
||||
}
|
||||
// the manager's employments from the almanac, the desk's allowed commands
|
||||
{
|
||||
const J desk = session.ui_read(O{{"kind", "desktop"}}, rev);
|
||||
const auto* jobs = at(at(at(desk, "data"), "manager"), "employments").array();
|
||||
const auto* allowed = at(at(at(desk, "meta"), "scope"), "allowedCommands").array();
|
||||
std::printf("(employments: %s)\n", jobs ? cli::dump_json(J(*jobs)).substr(0, 300).c_str() : "none");
|
||||
bool advance = false;
|
||||
if (allowed) for (const auto& a : *allowed) advance |= s(a) == "session.advance";
|
||||
check(jobs && !jobs->empty() && at((*jobs)[0], "teamId").string(), "employments of the manager");
|
||||
check(allowed && advance, "allowed commands of the desk");
|
||||
}
|
||||
const J few = session.ui_read(O{{"kind", "news"}, {"limit", 3}}, rev);
|
||||
check(at(at(few, "data"), "events").array() && at(at(few, "data"), "events").array()->size() == 3, "news limit");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user