Modern UI contract: lineup, tactics and training reads and commands
lineup.commit takes the squad order and swaps rows into place after opening the board as the desk does; tactics.commit sets the eight values through the board's checks; training.commit initializes the plan when needed and applies decreases before increases so every step stays within the limits. Each is one revision and is rolled back as a whole when the engine refuses a step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
99a48a463d
commit
78b827a0e6
6 files changed
+305
-11
No files matched your search
@@ -342,6 +342,17 @@ cli::Json ui_money(int64_t euros) {
|
||||
return O{{"minor", std::to_string(euros * 100)}, {"currency", "EUR"}, {"minorUnits", 2}};
|
||||
}
|
||||
|
||||
cli::Json ui_snapshot(const ModernState& g, const UiContext& c, const std::string& request_id, cli::Json data) {
|
||||
return snapshot(request_id, meta(g, c), std::move(data));
|
||||
}
|
||||
|
||||
std::string ui_team_id(const ModernState& g, int team) { return team_id(g, team); }
|
||||
|
||||
std::string ui_player_id(const ModernState& g, int player) {
|
||||
std::string id = entry(g.world_player_id, size_t(player));
|
||||
return id.empty() ? "player:legacy-" + std::to_string(player) : id;
|
||||
}
|
||||
|
||||
cli::Json ui_read(const ModernState& g, const UiContext& c, const cli::Json& request) {
|
||||
const std::string request_id = text_field(request, "requestId");
|
||||
const std::string kind = text_field(request, "kind");
|
||||
|
||||
Reference in new issue
Block a user