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

Targets and stop rules of "continue until". More...

Functions

GameDateValue windowEndDate (LeagueID league, const GameDateValue &today)
 
std::optional< GameDateValue > targetDate (const HolidayPlan &plan, const GameDateValue &today, const std::optional< GameDateValue > &next_match, LeagueID league)
 
std::optional< HolidayStop > checkStop (const HolidayPlan &plan, const HolidayDay &day)
 
const char * stopKey (HolidayStop stop)
 
HolidayPreferences loadPreferences (const std::shared_ptr< DatabaseConnection > &db_conn)
 
void savePreferences (const std::shared_ptr< DatabaseConnection > &db_conn, const HolidayPreferences &preferences)
 

Variables

constexpr std::uint16_t KEY_INJURY_DAYS = 14
 

Detailed Description

Targets and stop rules of "continue until".

Function Documentation

◆ checkStop()

std::optional< HolidayStop > Holiday::checkStop ( const HolidayPlan &  plan,
const HolidayDay &  day 
)

The first early-stop rule that fires today, most serious first.

◆ loadPreferences()

HolidayPreferences Holiday::loadPreferences ( const std::shared_ptr< DatabaseConnection > &  db_conn)

◆ savePreferences()

void Holiday::savePreferences ( const std::shared_ptr< DatabaseConnection > &  db_conn,
const HolidayPreferences &  preferences 
)

◆ stopKey()

const char * Holiday::stopKey ( HolidayStop  stop)

Language key of stop (e.g. "HOLIDAY_STOP_BIG_BID").

◆ targetDate()

std::optional< GameDateValue > Holiday::targetDate ( const HolidayPlan &  plan,
const GameDateValue &  today,
const std::optional< GameDateValue > &  next_match,
LeagueID  league 
)

Day the holiday ends on, or nullopt for open-ended modes (NextDecision) and when there is nothing to wait for. next_match is the day of the next unplayed managed fixture; league that of the managed club, whose country's transfer window counts.

◆ windowEndDate()

GameDateValue Holiday::windowEndDate ( LeagueID  league,
const GameDateValue &  today 
)

Day after the deadline of league's open window, or of its next one.

Variable Documentation

◆ KEY_INJURY_DAYS

constexpr std::uint16_t Holiday::KEY_INJURY_DAYS = 14
inlineconstexpr

Minimum layoff for a key player's injury to stop the holiday.