|
Player12
An open source football management simulator
|
Represents the tactical setup of a team for a match. More...
#include <strategy.h>
Public Member Functions | |
| Strategy () | |
| Default constructor, initializes global sliders and default weights. | |
| float | getAttackWeight (int roleIndex, int gridPosition) const |
| Get weights of a player at a specific grid cell. | |
| float | getDefenseWeight (int roleIndex, int gridPosition) const |
| Get defense weight of a player at a specific grid cell. | |
| void | setPressing (float value) |
| Sets the pressing slider value. | |
| void | setRiskTaking (float value) |
| Sets the risk taking slider value. | |
| void | setOffensiveBias (float value) |
| Sets the offensive bias slider value. | |
| void | setWidthUsage (float value) |
| Sets the width usage slider value. | |
| void | setCompactness (float value) |
| Sets the compactness slider value. | |
| void | setOutfieldWeights (int playerIndex, float attack, float defense, int radius) |
| Sets the role weights for a specific outfield player. | |
| RoleWeights & | getRole (int roleIndex) |
| Gets the role weights for a specific player (non-const). | |
| const RoleWeights & | getRole (int roleIndex) const |
| Gets the role weights for a specific player (const). | |
| void | setAllSliders (const StrategySliders &newSliders) |
| Sets all sliders at once. | |
| StrategySliders | getSliders () const |
| Retrieves the current slider state. | |
| void | setAllOutfieldWeights (float attack, float defense, int radius) |
| Applies the same weights to all outfield players. | |
| const std::vector< SlotInstruction > & | getSlotInstructions () const |
| void | setSlotInstructions (std::vector< SlotInstruction > instructions) |
| const SlotInstruction * | findSlot (Vector2F anchor) const |
| void | setSlot (const SlotInstruction &instruction) |
| TacticalRole | getKeeperRole () const |
| void | setKeeperRole (TacticalRole role) |
| const std::vector< PlayerInstruction > & | getOppositionOrders () const |
| void | setOppositionOrders (std::vector< PlayerInstruction > orders) |
Private Attributes | |
| StrategySliders | sliders |
| RoleWeights | goalkeeper = {0.0f, 1.0f, 1} |
| RoleWeights | outfield [10] |
| std::vector< SlotInstruction > | slots |
| TacticalRole | keeper_role = TacticalRole::Standard |
| std::vector< PlayerInstruction > | opposition_orders |
Represents the tactical setup of a team for a match.
Stores team sliders, tactical slot/keeper roles, possession offsets and opposition orders. The engine copies a Strategy and resolves its role profiles; changing a club's Strategy alone does not update a running match.
| Strategy::Strategy | ( | ) |
Default constructor, initializes global sliders and default weights.
| const SlotInstruction * Strategy::findSlot | ( | Vector2F | anchor | ) | const |
Instruction of the slot at anchor (lineup coordinates): the nearest stored one within TacticsTuning::SLOT_MATCH_DISTANCE, else nullptr.
| float Strategy::getAttackWeight | ( | int | roleIndex, |
| int | gridPosition | ||
| ) | const |
Get weights of a player at a specific grid cell.
| roleIndex | The index of the player's role. |
| gridPosition | The grid position to evaluate. |
| float Strategy::getDefenseWeight | ( | int | roleIndex, |
| int | gridPosition | ||
| ) | const |
Get defense weight of a player at a specific grid cell.
| roleIndex | The index of the player's role. |
| gridPosition | The grid position to evaluate. |
|
inline |
|
inline |
Instructions against players of the next opponent. Not saved with the tactic: the club's opposition plan is the saved copy and refreshes them.
| RoleWeights & Strategy::getRole | ( | int | roleIndex | ) |
Gets the role weights for a specific player (non-const).
| roleIndex | The index of the player. |
| const RoleWeights & Strategy::getRole | ( | int | roleIndex | ) | const |
Gets the role weights for a specific player (const).
| roleIndex | The index of the player. |
| StrategySliders Strategy::getSliders | ( | ) | const |
Retrieves the current slider state.
|
inline |
Every stored slot instruction (all formations used so far).
| void Strategy::setAllOutfieldWeights | ( | float | attack, |
| float | defense, | ||
| int | radius | ||
| ) |
Applies the same weights to all outfield players.
| attack | The attack weight to set. |
| defense | The defense weight to set. |
| radius | The movement radius to set. |
| void Strategy::setAllSliders | ( | const StrategySliders & | newSliders | ) |
Sets all sliders at once.
| newSliders | The new StrategySliders to apply. |
|
inline |
Sets the compactness slider value.
| void Strategy::setKeeperRole | ( | TacticalRole | role | ) |
|
inline |
Sets the offensive bias slider value.
| void Strategy::setOppositionOrders | ( | std::vector< PlayerInstruction > | orders | ) |
| void Strategy::setOutfieldWeights | ( | int | playerIndex, |
| float | attack, | ||
| float | defense, | ||
| int | radius | ||
| ) |
Sets the role weights for a specific outfield player.
| playerIndex | The zero-based outfield index (0-9). |
| attack | The attack weight to set. |
| defense | The defense weight to set. |
| radius | The movement radius to set. |
|
inline |
Sets the pressing slider value.
|
inline |
Sets the risk taking slider value.
| void Strategy::setSlot | ( | const SlotInstruction & | instruction | ) |
Stores the instruction of the slot at its anchor (replacing it).
| void Strategy::setSlotInstructions | ( | std::vector< SlotInstruction > | instructions | ) |
Replaces the slot instructions (persistence).
|
inline |
Sets the width usage slider value.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |