|
Player12
An open source football management simulator
|
Tactics dialog of the live match: style presets, the five instructions and the formation, edited as a draft and applied together. More...
#include <match_tactics_panel.h>
Classes | |
| struct | Snapshot |
Public Member Functions | |
| void | reset (const Strategy &plan) |
| Starts a match from the club's tactics (clears the history). | |
| bool | render (const TouchlineContext &context) |
| Draws the dialog while it is shown. | |
| void | resetPopup () |
| Next render() opens the popup again, with a fresh draft. | |
| void | requestClose () |
| Closes the dialog on its next frame. | |
| void | syncDraft (const TouchlineContext &context) |
| Draft starts again from the tactics in force. | |
| bool | hasChanges (const TouchlineContext &context) const |
| Whether the draft differs from the tactics in force. | |
| bool | apply (const TouchlineContext &context) |
| Sends the draft to the engine; false when nothing changed. | |
| bool | undo (const TouchlineContext &context) |
| Restores the tactics in force before the last apply. | |
| bool | canUndo () const |
| const Strategy & | getApplied () const |
Public Attributes | |
| StrategySliders | draft_sliders |
| std::vector< Vector2F > | draft_shape |
Static Public Attributes | |
| static constexpr const char * | WINDOW_ID = "###match_tactics_modal" |
Private Member Functions | |
| void | renderStyle () |
| void | renderInstructions () |
| void | renderFormation (const TouchlineContext &context) |
| void | renderFamiliarity (const TouchlineContext &context) |
| void | renderFooter (const TouchlineContext &context) |
Private Attributes | |
| Strategy | applied |
| std::vector< Snapshot > | history |
| bool | popup_opened = false |
| bool | close_requested = false |
Tactics dialog of the live match: style presets, the five instructions and the formation, edited as a draft and applied together.
The engine takes new instructions at once (the players re-form within a few seconds); a new shape costs some familiarity for a few minutes, which the dialog shows before applying. Every apply can be undone. In-match changes never alter the club's saved tactics.
| bool MatchTacticsPanel::apply | ( | const TouchlineContext & | context | ) |
Sends the draft to the engine; false when nothing changed.
|
inline |
|
inline |
| bool MatchTacticsPanel::hasChanges | ( | const TouchlineContext & | context | ) | const |
Whether the draft differs from the tactics in force.
| bool MatchTacticsPanel::render | ( | const TouchlineContext & | context | ) |
Draws the dialog while it is shown.
|
private |
|
private |
|
private |
|
private |
|
private |
|
inline |
Closes the dialog on its next frame.
| void MatchTacticsPanel::reset | ( | const Strategy & | plan | ) |
Starts a match from the club's tactics (clears the history).
|
inline |
Next render() opens the popup again, with a fresh draft.
| void MatchTacticsPanel::syncDraft | ( | const TouchlineContext & | context | ) |
Draft starts again from the tactics in force.
| bool MatchTacticsPanel::undo | ( | const TouchlineContext & | context | ) |
Restores the tactics in force before the last apply.
|
private |
|
private |
| std::vector<Vector2F> MatchTacticsPanel::draft_shape |
| StrategySliders MatchTacticsPanel::draft_sliders |
Edited instructions and outfield shape (lineup coordinates).
|
private |
|
private |
|
staticconstexpr |
Window id kept stable for tests and for the Escape handling.