When a stand block's construction weeks run out at a kickoff, the journal notes stadium.expansion_finished with the stadium's places. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
2.4 KiB
C++
47 lines
2.4 KiB
C++
// SPDX-License-Identifier: GPL-3.0-only
|
|
#pragma once
|
|
// The press journal of a Modern career (docs/new_engine/ui-anbindung.md, read "news"; the
|
|
// interface's press contract is docs/new_ui/integration/PRESS.md).
|
|
//
|
|
// Match events come from the almanac (statistics.hpp, query_news). Business events cannot be
|
|
// derived later, so they are noted once when they happen and saved with the career
|
|
// (ModernState::press): their id stays the same on every read, a deleted article is never
|
|
// produced again. Noting draws no random number and changes nothing else of the game.
|
|
//
|
|
// Sources:
|
|
// - a kickoff (session.advance, also live): the squads of the human clubs before and after
|
|
// give transfer.signed (with fromClub, or transfer.free from the pool), transfer.sold
|
|
// (toClub) and contract.ended (to the pool); a new toto settlement gives toto.win /
|
|
// toto.loss; a season change career.season_finished and career.season_started, and a human
|
|
// club in another league league.promoted / league.relegated;
|
|
// - confirmed commands: contract.extended (contract.offer), advertising.signed
|
|
// (advertising.accept), finance.loan_approved / finance.loan_repaid (bank.commit credit),
|
|
// stadium.expansion_planned (a stand block, stadium.commit), career.manager_resigned;
|
|
// - at a kickoff also: finance.profit / finance.loss (the cash change of the month just ended)
|
|
// and stadium.expansion_finished (a stand block's construction ran out).
|
|
// Fees are not known from the squads: the transfer events carry no fee (the renderer's
|
|
// fee-undisclosed variants).
|
|
|
|
#include <string>
|
|
|
|
#include "cli/json.hpp"
|
|
#include "modern/game/modern_state.hpp"
|
|
|
|
namespace bmh::modern {
|
|
|
|
// Notes an event of `team` (contract team id) on today's date with its facts.
|
|
void note_press(ModernState& g, const std::string& type, const std::string& team, cli::Json data);
|
|
|
|
// The events of the kickoff from `before` to `g` (see above).
|
|
void journal_advance(ModernState& g, const ModernState& before);
|
|
|
|
// The journal's events of `team` with from <= date <= until (ISO), in the form of query_news.
|
|
cli::Json::Array journal_events(const ModernState& g, const std::string& team, const std::string& from,
|
|
const std::string& until);
|
|
|
|
// A team / a player as the press facts name them ({id, name, kind} / {id, name}).
|
|
cli::Json press_team(const ModernState& g, int team);
|
|
cli::Json press_player(const ModernState& g, int player);
|
|
|
|
} // namespace bmh::modern
|