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

Staff ratings, effects, generation, wages and contracts. More...

Functions

std::array< StaffAttribute, 2 > keyAttributes (StaffRole role)
 
std::uint8_t rating (const StaffMember &member)
 
StaffEffects computeEffects (std::span< const StaffMember *const > staff)
 
std::uint32_t marketWage (const StaffMember &member)
 
std::uint32_t renewalWage (const StaffMember &member)
 
std::int64_t severance (const StaffMember &member)
 
std::array< std::uint8_t, STAFF_ROLE_COUNT > roleCounts (std::uint8_t reputation)
 
std::vector< StaffMember > generateClubStaff (const Team &team, const LeagueEconomy &economy, std::uint64_t world_seed, StaffRoster &roster)
 
void generateWorld (GameData &gamedata)
 
void refreshMarket (GameData &gamedata, std::int32_t ordinal)
 
std::vector< std::string > seasonEnd (GameData &gamedata, TeamID managed_team_id, std::uint16_t year)
 
float potentialErrorSd (float scouting_accuracy)
 
const char * roleKey (StaffRole role)
 
const char * roleDescriptionKey (StaffRole role)
 
const char * attributeKey (StaffAttribute attribute)
 

Variables

constexpr std::array< std::uint8_t, STAFF_ROLE_COUNT > ROLE_LIMITS
 
constexpr std::size_t MARKET_SIZE = 70
 
constexpr double FOOTBALL_STAFF_SHARE = 0.35
 

Detailed Description

Staff ratings, effects, generation, wages and contracts.

Function Documentation

◆ attributeKey()

const char * StaffModel::attributeKey ( StaffAttribute  attribute)

◆ computeEffects()

StaffEffects StaffModel::computeEffects ( std::span< const StaffMember *const >  staff)

Effects of a club's staff.

◆ generateClubStaff()

std::vector< StaffMember > StaffModel::generateClubStaff ( const Team &  team,
const LeagueEconomy &  economy,
std::uint64_t  world_seed,
StaffRoster &  roster 
)

Generates a club's staff: numbers and quality follow reputation, wages add up to the football-staff share of the club's non-player wages.

◆ generateWorld()

void StaffModel::generateWorld ( GameData &  gamedata)

Generates staff for every club plus the market (new worlds and saves from before staff existed).

◆ keyAttributes()

std::array< StaffAttribute, 2 > StaffModel::keyAttributes ( StaffRole  role)

The two attributes that matter most for a role.

◆ marketWage()

std::uint32_t StaffModel::marketWage ( const StaffMember &  member)

Weekly wage a member asks for on the market.

◆ potentialErrorSd()

float StaffModel::potentialErrorSd ( float  scouting_accuracy)

Standard deviation of a scout's potential estimate in overall points: the youth potential spread (9) divided by d' = 0.8 + 1.3 * accuracy.

◆ rating()

std::uint8_t StaffModel::rating ( const StaffMember &  member)

Role rating (1-100) from the role's key attributes.

◆ refreshMarket()

void StaffModel::refreshMarket ( GameData &  gamedata,
std::int32_t  ordinal 
)

Replaces part of the market with new candidates (monthly).

◆ renewalWage()

std::uint32_t StaffModel::renewalWage ( const StaffMember &  member)

Weekly wage asked to extend a contract.

◆ roleCounts()

std::array< std::uint8_t, STAFF_ROLE_COUNT > StaffModel::roleCounts ( std::uint8_t  reputation)

Staff members a club employs per role at a reputation.

◆ roleDescriptionKey()

const char * StaffModel::roleDescriptionKey ( StaffRole  role)

◆ roleKey()

const char * StaffModel::roleKey ( StaffRole  role)

Language keys.

◆ seasonEnd()

std::vector< std::string > StaffModel::seasonEnd ( GameData &  gamedata,
TeamID  managed_team_id,
std::uint16_t  year 
)

Season end: ageing, retirements, contract expiry (AI clubs mostly renew and refill vacancies from the market).

Returns
Names of the managed club's staff whose contracts ran out.

◆ severance()

std::int64_t StaffModel::severance ( const StaffMember &  member)

Compensation for terminating a contract (up to a year's wages).

Variable Documentation

◆ FOOTBALL_STAFF_SHARE

constexpr double StaffModel::FOOTBALL_STAFF_SHARE = 0.35
inlineconstexprprivate

Share of non-player wages paid to football staff. [P]

◆ MARKET_SIZE

constexpr std::size_t StaffModel::MARKET_SIZE = 70
inlineconstexprprivate

Target size of the staff market.

◆ ROLE_LIMITS

constexpr std::array<std::uint8_t, STAFF_ROLE_COUNT> StaffModel::ROLE_LIMITS
inlineconstexprprivate
Initial value:
= {
1, 2, 2, 2, 1, 2, 4, 2, 6, 1}

Most members a club may employ per role.