Player12
An open source football management simulator
Loading...
Searching...
No Matches
TrainingSystem Namespace Reference

Training processing on the live world (called by WorldSimulation). More...

Typedefs

using FixtureOutlook = std::unordered_map< TeamID, std::uint8_t >
 

Functions

void planDay (GameData &gamedata, std::int32_t ordinal, const FixtureOutlook *outlook, bool training_period)
 
void rollWorkloads (GameData &gamedata)
 
double trainPlayer (GameData &gamedata, Player &player, std::int32_t ordinal)
 
double recordMatchLoad (GameData &gamedata, const Player &player, std::uint8_t minutes)
 
void recordTeamMatch (GameData &gamedata, TeamID team_id, std::int32_t ordinal)
 
float trainingQuality (const GameData &gamedata, const Player &player)
 
float directGrowth (GameData &gamedata, Player &player, float growth)
 
void recordWeeklyGrowth (GameData &gamedata, PlayerID player_id, float delta)
 
void endWeek (GameData &gamedata)
 
AdviceInputs adviceInputs (const GameData &gamedata, TeamID team_id, int matches_next_week)
 
float tacticalFamiliarity (const GameData &gamedata, TeamID team_id)
 

Detailed Description

Training processing on the live world (called by WorldSimulation).

Typedef Documentation

◆ FixtureOutlook

using TrainingSystem::FixtureOutlook = typedef std::unordered_map<TeamID, std::uint8_t>
private

Days to each club's next fixture (0 = today), for clubs with one soon.

Function Documentation

◆ adviceInputs()

AdviceInputs TrainingSystem::adviceInputs ( const GameData &  gamedata,
TeamID  team_id,
int  matches_next_week 
)

Squad facts for the assistant's advice.

◆ directGrowth()

float TrainingSystem::directGrowth ( GameData &  gamedata,
Player &  player,
float  growth 
)

Directed growth for a player (see TrainingModel::applyDirectedGrowth).

◆ endWeek()

void TrainingSystem::endWeek ( GameData &  gamedata)

Ends the training week of every club (load bookkeeping).

◆ planDay()

void TrainingSystem::planDay ( GameData &  gamedata,
std::int32_t  ordinal,
const FixtureOutlook *  outlook,
bool  training_period 
)

Plans the day of every club (session, congestion, familiarity).

Parameters
outlookUpcoming fixtures, or nullptr when the calendar is unknown (a weekly rhythm after the last match is assumed).
training_periodFalse during the June holiday.

◆ recordMatchLoad()

double TrainingSystem::recordMatchLoad ( GameData &  gamedata,
const Player &  player,
std::uint8_t  minutes 
)

Adds match load and returns the match injury hazard multiplier.

◆ recordTeamMatch()

void TrainingSystem::recordTeamMatch ( GameData &  gamedata,
TeamID  team_id,
std::int32_t  ordinal 
)

Marks a match day for a club (microcycle anchor, familiarity).

◆ recordWeeklyGrowth()

void TrainingSystem::recordWeeklyGrowth ( GameData &  gamedata,
PlayerID  player_id,
float  delta 
)

Records a player's weekly change of overall rating (trend arrows).

◆ rollWorkloads()

void TrainingSystem::rollWorkloads ( GameData &  gamedata)

Folds yesterday's load into the workload history of every player.

◆ tacticalFamiliarity()

float TrainingSystem::tacticalFamiliarity ( const GameData &  gamedata,
TeamID  team_id 
)

Tactical familiarity of a club with its current strategy and formation, in [0, 1] (1 = fully drilled). It grows with tactical and match-preparation sessions, matches and time, and drops when sliders or the outfield shape change. Intended match-engine use: scale positional discipline / decision noise, e.g. by 0.9 + 0.1 * familiarity.

◆ trainingQuality()

float TrainingSystem::trainingQuality ( const GameData &  gamedata,
const Player &  player 
)

Development multiplier T (facilities, staff, volume, preset).

◆ trainPlayer()

double TrainingSystem::trainPlayer ( GameData &  gamedata,
Player &  player,
std::int32_t  ordinal 
)

Trains one fit player of a club on day ordinal: adds load, drains condition, speeds recovery, builds sharpness. Players who played outside the club's rhythm recover first; on MD+1 the players who did not play do a compensation session.

Returns
Training-injury exposure (0 when not training), including the workload and medical staff multipliers.