102 std::span<const Player* const> bench,
115 [[nodiscard]] std::span<const PlannedSubstitution>
entries()
const
135 std::span<const Player* const> bench);
142 MatchEngine& engine,
bool home, std::span<const Player* const> bench);
175 const MatchEngine& engine,
bool home, std::span<const Player* const> bench,
196 "TACTIC_BALANCED_HELP",
197 {0.50f, 0.50f, 0.50f, 0.50f, 0.50f}},
198 {
"TACTIC_FRONT_FOOT",
199 "TACTIC_FRONT_FOOT_HELP",
200 {0.82f, 0.72f, 0.76f, 0.68f, 0.64f}},
202 "TACTIC_COUNTER_HELP",
203 {0.38f, 0.68f, 0.62f, 0.58f, 0.42f}},
205 "TACTIC_CONTROL_HELP",
206 {0.62f, 0.34f, 0.44f, 0.72f, 0.72f}},
220 "TACTIC_PRESSING_HELP"},
224 "TACTIC_OFFENSIVE_HELP"},
226 "TACTIC_WIDTH_HELP"},
228 "TACTIC_COMPACTNESS_HELP"},
253float reshapeCost(std::span<const Vector2F> from, std::span<const Vector2F> to);
264inline constexpr std::array<ShoutInfo, 11>
SHOUTS{{
273 "SHOUT_KEEP_POSSESSION_HINT"},
275 "SHOUT_HIT_ON_COUNTER_HINT"},
277 "SHOUT_WORK_BALL_INTO_BOX_HINT"},
279 "SHOUT_SHOOT_ON_SIGHT_HINT"},
Substitutions queued by the manager and made together, so they share one stoppage and one window.
Definition match_changes.h:94
std::vector< PlannedSubstitution > planned
Definition match_changes.h:145
bool isConfirmed() const
Definition match_changes.h:127
void clear()
Drops every planned change and the confirmation.
Definition match_changes.cpp:178
bool involves(PlayerID player) const
The player is leaving or coming on in a planned change.
Definition match_changes.cpp:184
void confirm()
Hands the plan to the referee: made at the next stoppage.
Definition match_changes.h:126
std::span< const PlannedSubstitution > entries() const
Definition match_changes.h:115
std::vector< SubstitutionOutcome > apply(MatchEngine &engine, bool home, std::span< const Player *const > bench)
Makes every planned change now, in order, without advancing the engine in between (so they count as o...
Definition match_changes.cpp:199
std::vector< SubstitutionOutcome > applyIfDue(MatchEngine &engine, bool home, std::span< const Player *const > bench)
apply() once the plan is confirmed and play has stopped; nothing (an empty result) otherwise.
Definition match_changes.cpp:223
PlayerID replacementFor(PlayerID out) const
Planned replacement of an outgoing player (0 when none).
Definition match_changes.cpp:192
bool remove(std::size_t index)
Drops one planned change (false for a bad index).
Definition match_changes.cpp:170
Refusal add(const MatchEngine &engine, bool home, std::span< const Player *const > bench, PlayerID out, PlayerID in)
check() and, when allowed, appends the change.
Definition match_changes.cpp:161
bool confirmed
Definition match_changes.h:146
Refusal check(const MatchEngine &engine, bool home, std::span< const Player *const > bench, PlayerID out, PlayerID in) const
Whether out can be replaced by in given the rules and the changes already planned (nothing is added).
Definition match_changes.cpp:145
bool empty() const
Definition match_changes.h:119
Definition match_engine.h:517
Persistent career identity, attributes, traits and day-to-day state.
Definition player.h:104
MatchShout
Definition match_engine.h:333
Touchline decisions of the live match, independent of the widgets: planned substitutions made togethe...
Definition match_changes.cpp:20
float reshapeCost(std::span< const Vector2F > from, std::span< const Vector2F > to)
Tactical familiarity the side gives up for a while when its shape changes from from to to,...
Definition match_changes.cpp:431
constexpr std::array< ShoutInfo, 11 > SHOUTS
Every shout, in bar order (Shift+1 .. Shift+0, Shift+-).
Definition match_changes.h:264
Refusal rulesRefusal(const MatchEngine &engine, bool home, int planned)
Refusal from the match rules alone (limit, windows, full time) for one more change when planned chang...
Definition match_changes.cpp:101
std::vector< Vector2F > formationFor(const MatchEngine &engine, bool home, const Formation::Preset &preset)
The side's current shape rearranged as preset: each occupied slot gets the preset position that best ...
Definition match_changes.cpp:373
const char * refusalKey(Refusal refusal)
Language key explaining a refusal (LIMIT and WINDOWS take d).
Definition match_changes.cpp:74
int detectFormation(std::span< const Vector2F > shape)
Index of the formation preset with this shape, or -1 (custom).
Definition match_changes.cpp:343
constexpr std::array< SliderInfo, 5 > TACTIC_SLIDERS
Definition match_changes.h:218
float positionFit(PlayerRole substitute, PlayerRole position)
Suitability of a substitute for the outgoing player's position in [0, 1] (the natural role fit,...
Definition match_changes.cpp:230
int detectTacticPreset(const StrategySliders &sliders)
Index of the preset with these sliders, or -1 (custom).
Definition match_changes.cpp:335
Refusal
Why a change cannot be made (NONE when it can).
Definition match_changes.h:38
constexpr std::array< TacticPreset, 4 > TACTIC_PRESETS
Balanced, front foot, counter and control.
Definition match_changes.h:194
SuggestionReason
Reasons behind a suggested substitution (bit flags).
Definition match_changes.h:151
@ SUGGEST_BOOKED
Definition match_changes.h:154
@ SUGGEST_TIRED
Definition match_changes.h:153
@ SUGGEST_INJURED
Definition match_changes.h:152
bool atStoppage(const MatchEngine &engine)
Play is stopped: planned changes can be made without waiting.
Definition match_changes.cpp:131
bool sameSliders(const StrategySliders &left, const StrategySliders &right)
Every slider within a small tolerance.
Definition match_changes.cpp:324
int maxWindows(const MatchEngine &engine)
Substitution windows of a side in this match (one more in ET).
Definition match_changes.cpp:123
std::vector< Suggestion > suggestSubstitutions(const MatchEngine &engine, bool home, std::span< const Player *const > bench, const SubstitutionPlan &plan, const StatsConfig &config, std::size_t maximum)
Up to maximum substitutions the assistant would make now: injured players first, then tired ones and ...
Definition match_changes.cpp:235
int maxSubstitutions(const MatchEngine &engine)
Substitutions a side may make in this match (one more in ET).
Definition match_changes.cpp:115
int index
Definition runtime_editor.cpp:94
std::int64_t maximum
Definition runtime_editor_validation.cpp:47
Contains structures to simplify JSON parsing and loading of player statistics.
One planned substitution.
Definition match_changes.h:77
PlayerID in
Definition match_changes.h:79
PlayerID out
Definition match_changes.h:78
One touchline shout: its labels and keyboard slot.
Definition match_changes.h:257
MatchShout shout
Definition match_changes.h:258
const char * labelKey
Definition match_changes.h:259
const char * hintKey
Definition match_changes.h:260
One strategy slider: label, help and the member it edits.
Definition match_changes.h:211
float StrategySliders::* value
Definition match_changes.h:214
const char * helpKey
Definition match_changes.h:215
const char * key
Definition match_changes.h:212
const char * id
Definition match_changes.h:213
Result of one planned change once it was attempted.
Definition match_changes.h:84
PlannedSubstitution change
Definition match_changes.h:85
Refusal refusal
Definition match_changes.h:86
The assistant's proposal: replace out with in.
Definition match_changes.h:159
PlayerID in
Definition match_changes.h:161
PlayerID out
Definition match_changes.h:160
std::uint8_t reasons
Definition match_changes.h:162
float condition
Definition match_changes.h:164
A named set of the five strategy sliders.
Definition match_changes.h:187
const char * nameKey
Definition match_changes.h:188
StrategySliders sliders
Definition match_changes.h:190
const char * descriptionKey
Definition match_changes.h:189
Configuration mapping roles to their focus areas and listing all possible stats.
Definition stats_config.h:42
Team-wide tactical preferences in [0, 1].
Definition strategy.h:27
float pressing
Definition strategy.h:28
float widthUsage
Definition strategy.h:33
float compactness
Definition strategy.h:34
float riskTaking
Definition strategy.h:29
float offensiveBias
Definition strategy.h:31
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21
PlayerRole
Represents a specific tactical role on the pitch.
Definition types.h:63