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

Functions

BoardObjective objectiveFor (int expected_position, int league_size)
 
std::uint8_t targetPosition (BoardObjective objective, int league_size)
 
const char * objectiveKey (BoardObjective objective)
 
float expectedPoints (float own_strength, float opponent_strength, bool home)
 
void recordMatch (BoardState &state, float points, float expected_points)
 
BoardReviewOutcome monthlyReview (BoardState &state, int position, int league_size, bool negative_balance, bool over_wage_budget, bool in_season)
 
void seasonReview (BoardState &state, int final_position)
 
void adjustConfidence (BoardState &state, float delta)
 
CupObjective cupObjectiveFor (BoardObjective objective, int tier)
 
FinanceObjective financeObjectiveFor (float tight_budget, std::int64_t balance)
 
std::uint8_t youthTargetFor (float youth_focus)
 
const char * cupObjectiveKey (CupObjective objective)
 
const char * financeObjectiveKey (FinanceObjective objective)
 
const char * youthTargetKey (std::uint8_t target)
 
ObjectiveGrade gradeCup (CupObjective objective, std::optional< int > rounds_left, bool won, bool still_in)
 
const char * targetStatusKey (ObjectiveGrade grade)
 
ObjectiveGrade gradeLeague (int target_position, int position, int league_size)
 
ObjectiveGrade gradeFinances (FinanceObjective objective, std::int64_t balance, std::int64_t start_balance, bool over_wage_budget)
 
ObjectiveGrade gradeYouth (std::uint8_t target, int young_regulars)
 
ProjectQuote quoteProject (FacilityProjectType type, std::uint8_t current_level, std::uint32_t capacity, std::uint8_t reputation, double season_income, std::uint32_t seats)
 
ProjectVerdict reviewProject (const ProjectQuote &quote, const ProjectRequestContext &context)
 
float medicalLayoffMultiplier (std::uint8_t medical_level)
 
const char * projectTypeKey (FacilityProjectType type)
 
const char * projectVerdictKey (ProjectVerdict verdict)
 

Variables

constexpr int PROJECT_COOLDOWN_DAYS = 90
 
constexpr int MAX_RUNNING_PROJECTS = 2
 
constexpr int PROJECT_CASH_RESERVE_WEEKS = 16
 
constexpr float PROJECT_MIN_CONFIDENCE = 45.0f
 
constexpr std::uint32_t MIN_EXPANSION_SEATS = 1'000
 
constexpr std::uint32_t MAX_STADIUM_CAPACITY = 100'000
 

Function Documentation

◆ adjustConfidence()

void BoardModel::adjustConfidence ( BoardState &  state,
float  delta 
)

Moves the board's confidence by delta points (clamped to 0-100).

◆ cupObjectiveFor()

CupObjective BoardModel::cupObjectiveFor ( BoardObjective  objective,
int  tier 
)

Cup target of a club with objective in a division of tier.

◆ cupObjectiveKey()

const char * BoardModel::cupObjectiveKey ( CupObjective  objective)

Language keys of the targets (e.g. "BOARD_CUP_SEMI_FINAL").

◆ expectedPoints()

float BoardModel::expectedPoints ( float  own_strength,
float  opponent_strength,
bool  home 
)

Expected league points of a match from both line-up strengths (mean overall), including home advantage. [P] Elo-style logistic with a draw band.

◆ financeObjectiveFor()

FinanceObjective BoardModel::financeObjectiveFor ( float  tight_budget,
std::int64_t  balance 
)

Finance target: tight budgets and clubs in the red must break even.

◆ financeObjectiveKey()

const char * BoardModel::financeObjectiveKey ( FinanceObjective  objective)

◆ gradeCup()

ObjectiveGrade BoardModel::gradeCup ( CupObjective  objective,
std::optional< int >  rounds_left,
bool  won,
bool  still_in 
)

Cup run against its target. rounds_left is how many rounds were still to come after the furthest one the club played (0 = it played the final; nullopt = it has not played yet). While still_in the run is on track.

◆ gradeFinances()

ObjectiveGrade BoardModel::gradeFinances ( FinanceObjective  objective,
std::int64_t  balance,
std::int64_t  start_balance,
bool  over_wage_budget 
)

Books against the finance target.

◆ gradeLeague()

ObjectiveGrade BoardModel::gradeLeague ( int  target_position,
int  position,
int  league_size 
)

League position against the worst acceptable one, a quarter of the table per grade.

◆ gradeYouth()

ObjectiveGrade BoardModel::gradeYouth ( std::uint8_t  target,
int  young_regulars 
)

Young regulars against the youth target.

◆ medicalLayoffMultiplier()

float BoardModel::medicalLayoffMultiplier ( std::uint8_t  medical_level)

Layoff multiplier of a medical centre level: 1.0 up to 50, 0.85 at 100.

◆ monthlyReview()

BoardReviewOutcome BoardModel::monthlyReview ( BoardState &  state,
int  position,
int  league_size,
bool  negative_balance,
bool  over_wage_budget,
bool  in_season = true 
)

Monthly review of league position (vs target) and finances. Dismissal needs several consecutive critical reviews after enough matches, so only sustained, extreme failure ends the job. Out of the league season (in_season false) only the finances are reviewed and nobody is dismissed: the season is judged once, when it ends.

◆ objectiveFor()

BoardObjective BoardModel::objectiveFor ( int  expected_position,
int  league_size 
)

Objective for a club expected to finish expected_position. The expectation comes from the wage-bill rank because wages explain most of the variation in league position (Szymanski).

◆ objectiveKey()

const char * BoardModel::objectiveKey ( BoardObjective  objective)

Language key naming objective.

◆ projectTypeKey()

const char * BoardModel::projectTypeKey ( FacilityProjectType  type)

Language keys (e.g. "PROJECT_TRAINING_GROUND", "PROJECT_VERDICT_...").

◆ projectVerdictKey()

const char * BoardModel::projectVerdictKey ( ProjectVerdict  verdict)

◆ quoteProject()

ProjectQuote BoardModel::quoteProject ( FacilityProjectType  type,
std::uint8_t  current_level,
std::uint32_t  capacity,
std::uint8_t  reputation,
double  season_income,
std::uint32_t  seats 
)

Quote for type: facilities rise 10 levels (6% / 3.5% of a season's income, more at higher levels) over six / four months; a stadium grows by seats (rounded to 500, at most half the current capacity) at a per-seat price rising with the club's stature, over 8-14 months, with a tenth of the ground closed meanwhile. [P]

◆ recordMatch()

void BoardModel::recordMatch ( BoardState &  state,
float  points,
float  expected_points 
)

Records a league result: confidence moves with results relative to expectation over the last eight matches, B = 0.9 B + 0.1 (50 + 25 z).

◆ reviewProject()

ProjectVerdict BoardModel::reviewProject ( const ProjectQuote &  quote,
const ProjectRequestContext &  context 
)

Board decision on a quoted project.

◆ seasonReview()

void BoardModel::seasonReview ( BoardState &  state,
int  final_position 
)

Season-end adjustment from the final position.

◆ targetPosition()

std::uint8_t BoardModel::targetPosition ( BoardObjective  objective,
int  league_size 
)

Worst acceptable league position for objective.

◆ targetStatusKey()

const char * BoardModel::targetStatusKey ( ObjectiveGrade  grade)

How a target is going during the season (e.g. "BOARD_STATUS_BEHIND").

◆ youthTargetFor()

std::uint8_t BoardModel::youthTargetFor ( float  youth_focus)

Young regulars a board with youth_focus (0-1) expects; 0 = none.

◆ youthTargetKey()

const char * BoardModel::youthTargetKey ( std::uint8_t  target)

Variable Documentation

◆ MAX_RUNNING_PROJECTS

constexpr int BoardModel::MAX_RUNNING_PROJECTS = 2
inlineconstexpr

◆ MAX_STADIUM_CAPACITY

constexpr std::uint32_t BoardModel::MAX_STADIUM_CAPACITY = 100'000
inlineconstexpr

◆ MIN_EXPANSION_SEATS

constexpr std::uint32_t BoardModel::MIN_EXPANSION_SEATS = 1'000
inlineconstexpr

◆ PROJECT_CASH_RESERVE_WEEKS

constexpr int BoardModel::PROJECT_CASH_RESERVE_WEEKS = 16
inlineconstexpr

Weeks of payroll the cash must still cover after paying the project.

◆ PROJECT_COOLDOWN_DAYS

constexpr int BoardModel::PROJECT_COOLDOWN_DAYS = 90
inlineconstexpr

Days a refused request of the same type waits before it can be asked again.

◆ PROJECT_MIN_CONFIDENCE

constexpr float BoardModel::PROJECT_MIN_CONFIDENCE = 45.0f
inlineconstexpr