|
Player12
An open source football management simulator
|
Touchline decisions of the live match, independent of the widgets: planned substitutions made together at a stoppage, the assistant's suggestions, tactical presets, formation changes and the shouts on offer. More...
Classes | |
| struct | PlannedSubstitution |
| One planned substitution. More... | |
| struct | ShoutInfo |
| One touchline shout: its labels and keyboard slot. More... | |
| struct | SliderInfo |
| One strategy slider: label, help and the member it edits. More... | |
| struct | SubstitutionOutcome |
| Result of one planned change once it was attempted. More... | |
| class | SubstitutionPlan |
| Substitutions queued by the manager and made together, so they share one stoppage and one window. More... | |
| struct | Suggestion |
The assistant's proposal: replace out with in. More... | |
| struct | TacticPreset |
| A named set of the five strategy sliders. More... | |
Enumerations | |
| enum class | Refusal : std::uint8_t { NONE , MATCH_OVER , LIMIT , WINDOWS , NOT_NOW , NOT_ON_PITCH , NOT_ON_BENCH , ALREADY_PLAYED , ALREADY_PLANNED } |
| Why a change cannot be made (NONE when it can). More... | |
| enum | SuggestionReason : std::uint8_t { SUGGEST_INJURED = 1U << 0U , SUGGEST_TIRED = 1U << 1U , SUGGEST_BOOKED = 1U << 2U } |
| Reasons behind a suggested substitution (bit flags). More... | |
Functions | |
| const char * | refusalKey (Refusal refusal) |
| Language key explaining a refusal (LIMIT and WINDOWS take d). | |
| 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 changes are already waiting. | |
| int | maxSubstitutions (const MatchEngine &engine) |
| Substitutions a side may make in this match (one more in ET). | |
| int | maxWindows (const MatchEngine &engine) |
| Substitution windows of a side in this match (one more in ET). | |
| bool | atStoppage (const MatchEngine &engine) |
| Play is stopped: planned changes can be made without waiting. | |
| float | positionFit (PlayerRole substitute, PlayerRole position) |
| Suitability of a substitute for the outgoing player's position in [0, 1] (the natural role fit, see Formation::roleFit). | |
| 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 booked defenders or midfielders late in the game, each with the best free substitute for the position (goalkeepers only for goalkeepers). Players already in the plan are left out; nothing is suggested when no change is allowed. | |
| bool | sameSliders (const StrategySliders &left, const StrategySliders &right) |
| Every slider within a small tolerance. | |
| int | detectTacticPreset (const StrategySliders &sliders) |
| Index of the preset with these sliders, or -1 (custom). | |
| int | detectFormation (std::span< const Vector2F > shape) |
| Index of the formation preset with this shape, or -1 (custom). | |
| 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 suits its player (natural role first, then the nearest spot), empty slots take what is left. Returns the current shape unchanged when it does not have ten slots. | |
| 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, in [0, 1] (the engine's reshape rule). | |
Variables | |
| constexpr std::array< TacticPreset, 4 > | TACTIC_PRESETS |
| Balanced, front foot, counter and control. | |
| constexpr std::array< SliderInfo, 5 > | TACTIC_SLIDERS |
| constexpr std::array< ShoutInfo, 11 > | SHOUTS |
| Every shout, in bar order (Shift+1 .. Shift+0, Shift+-). | |
Touchline decisions of the live match, independent of the widgets: planned substitutions made together at a stoppage, the assistant's suggestions, tactical presets, formation changes and the shouts on offer.
Every change goes through the engine, which owns the rules; the plan only explains in advance why a change would be refused.
|
strong |
Why a change cannot be made (NONE when it can).
| enum MatchChanges::SuggestionReason : std::uint8_t |
| bool MatchChanges::atStoppage | ( | const MatchEngine & | engine | ) |
Play is stopped: planned changes can be made without waiting.
| int MatchChanges::detectFormation | ( | std::span< const Vector2F > | shape | ) |
Index of the formation preset with this shape, or -1 (custom).
| int MatchChanges::detectTacticPreset | ( | const StrategySliders & | sliders | ) |
Index of the preset with these sliders, or -1 (custom).
| std::vector< Vector2F > MatchChanges::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 suits its player (natural role first, then the nearest spot), empty slots take what is left. Returns the current shape unchanged when it does not have ten slots.
| int MatchChanges::maxSubstitutions | ( | const MatchEngine & | engine | ) |
Substitutions a side may make in this match (one more in ET).
| int MatchChanges::maxWindows | ( | const MatchEngine & | engine | ) |
Substitution windows of a side in this match (one more in ET).
| float MatchChanges::positionFit | ( | PlayerRole | substitute, |
| PlayerRole | position | ||
| ) |
Suitability of a substitute for the outgoing player's position in [0, 1] (the natural role fit, see Formation::roleFit).
| const char * MatchChanges::refusalKey | ( | Refusal | refusal | ) |
Language key explaining a refusal (LIMIT and WINDOWS take d).
| float MatchChanges::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, in [0, 1] (the engine's reshape rule).
| Refusal MatchChanges::rulesRefusal | ( | const MatchEngine & | engine, |
| bool | home, | ||
| int | planned | ||
| ) |
Refusal from the match rules alone (limit, windows, full time) for one more change when planned changes are already waiting.
| bool MatchChanges::sameSliders | ( | const StrategySliders & | left, |
| const StrategySliders & | right | ||
| ) |
Every slider within a small tolerance.
| std::vector< Suggestion > MatchChanges::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 booked defenders or midfielders late in the game, each with the best free substitute for the position (goalkeepers only for goalkeepers). Players already in the plan are left out; nothing is suggested when no change is allowed.
|
inlineconstexpr |
Every shout, in bar order (Shift+1 .. Shift+0, Shift+-).
|
inlineconstexpr |
Balanced, front foot, counter and control.
|
inlineconstexpr |