Player12
An open source football management simulator
Loading...
Searching...
No Matches
MatchTacticsPanel Class Reference

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
 

Detailed Description

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.

Member Function Documentation

◆ apply()

bool MatchTacticsPanel::apply ( const TouchlineContext &  context)

Sends the draft to the engine; false when nothing changed.

◆ canUndo()

bool MatchTacticsPanel::canUndo ( ) const
inline

◆ getApplied()

const Strategy & MatchTacticsPanel::getApplied ( ) const
inline

◆ hasChanges()

bool MatchTacticsPanel::hasChanges ( const TouchlineContext &  context) const

Whether the draft differs from the tactics in force.

◆ render()

bool MatchTacticsPanel::render ( const TouchlineContext &  context)

Draws the dialog while it is shown.

Returns
False once it closed (Close, Escape or another dialog).

◆ renderFamiliarity()

void MatchTacticsPanel::renderFamiliarity ( const TouchlineContext &  context)
private

◆ renderFooter()

void MatchTacticsPanel::renderFooter ( const TouchlineContext &  context)
private

◆ renderFormation()

void MatchTacticsPanel::renderFormation ( const TouchlineContext &  context)
private

◆ renderInstructions()

void MatchTacticsPanel::renderInstructions ( )
private

◆ renderStyle()

void MatchTacticsPanel::renderStyle ( )
private

◆ requestClose()

void MatchTacticsPanel::requestClose ( )
inline

Closes the dialog on its next frame.

◆ reset()

void MatchTacticsPanel::reset ( const Strategy &  plan)

Starts a match from the club's tactics (clears the history).

◆ resetPopup()

void MatchTacticsPanel::resetPopup ( )
inline

Next render() opens the popup again, with a fresh draft.

◆ syncDraft()

void MatchTacticsPanel::syncDraft ( const TouchlineContext &  context)

Draft starts again from the tactics in force.

◆ undo()

bool MatchTacticsPanel::undo ( const TouchlineContext &  context)

Restores the tactics in force before the last apply.

Member Data Documentation

◆ applied

Strategy MatchTacticsPanel::applied
private

◆ close_requested

bool MatchTacticsPanel::close_requested = false
private

◆ draft_shape

std::vector<Vector2F> MatchTacticsPanel::draft_shape

◆ draft_sliders

StrategySliders MatchTacticsPanel::draft_sliders

Edited instructions and outfield shape (lineup coordinates).

◆ history

std::vector<Snapshot> MatchTacticsPanel::history
private

◆ popup_opened

bool MatchTacticsPanel::popup_opened = false
private

◆ WINDOW_ID

constexpr const char* MatchTacticsPanel::WINDOW_ID = "###match_tactics_modal"
staticconstexpr

Window id kept stable for tests and for the Escape handling.


The documentation for this class was generated from the following files: