Start Modern managers with the assistant's attitude control; name live tactic values

A new Modern manager's assistant adapts the attitude to the score, as the
computer clubs do, until the manager sets it himself; an idle human club
no longer plays whole matches at the most defensive attitude (12-season
simulation: 1.40 instead of 1.12 goals per match, league average 1.44).
The live tactics board shows values in words, and refused live commands
are written to stderr.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-14 08:12:03 +01:00
1 parent 6970dfa20a
commit f2dcf94d2b
5 files changed
+28 -2

No files matched your search

+4
View File
@@ -60,6 +60,8 @@ void App::engine_live_begin(const Json &state, const std::string &revision) {
{"value", control.at("value")}});
} catch (const std::exception &) { engine_live_tactics_ = Json::array(); }
if (engine_live_tactics_.size() != 8) engine_live_tactics_ = Json::array();
try { engine_live_assistant_ = engine_data_.at("tactics").at("data").value("assistantAttitude", 0) != 0; }
catch (const std::exception &) { engine_live_assistant_ = false; }
const auto fixture = engine_live_progress(Json(), state, engine_data_, engine_live_roster_);
if (!fixture.value("ok", false) || !live_.open(fixture, "")) {
// nothing the ticker can show: the kickoff is simply played to its end
@@ -94,6 +96,7 @@ void App::engine_live_poll() {
const Json response = result.value("response", Json::object()), state = result.value("live", Json::object());
const bool accepted = response.value("messageType", "") == "command_result";
if (accepted) engine_live_revision_ = response.value("newRevision", engine_live_revision_);
else std::fprintf(stderr, "live command %s refused: %s%c", kind.c_str(), response.dump().c_str(), '\n');
if (kind == "live.substitute") {
if (accepted && engine_live_swap_.is_array() && engine_live_swap_.size() == 2) {
// the engine swapped the two rows of the line-up; the team tab follows
@@ -117,6 +120,7 @@ void App::engine_live_poll() {
}
if (kind == "live.tactics") {
if (accepted && engine_live_tactics_sent_.is_array() && engine_live_tactics_sent_.size() == engine_live_tactics_.size()) {
if (engine_live_tactics_[0].at("value") != engine_live_tactics_sent_[0]) engine_live_assistant_ = false;
for (size_t i = 0; i < engine_live_tactics_.size(); ++i) engine_live_tactics_[i]["value"] = engine_live_tactics_sent_[i];
live_feedback_ = "Taktik geändert.";
} else if (!accepted) {