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

Classes

struct  CountryRules
 
struct  MonthDay
 
struct  Period
 

Functions

std::span< const CountryRules > countries ()
 
const CountryRules & rulesFor (LeagueID league)
 
bool isOpen (LeagueID league, const GameDateValue &date)
 
bool isOpenAnywhere (const GameDateValue &date)
 
bool isStartOfYearWindow (LeagueID league, const GameDateValue &date)
 
std::optional< GameDateValue > windowEnd (LeagueID league, const GameDateValue &date)
 
bool isDeadlineDay (LeagueID league, const GameDateValue &date)
 
GameDateValue nextOpening (LeagueID league, const GameDateValue &date)
 
bool canSignFreeAgent (LeagueID league, const GameDateValue &date)
 

Variables

constexpr std::int16_t FREE_AGENTS_ANY_TIME = -1
 

Detailed Description

Registration periods (transfer windows) of each country.

A club can register a player from another club only while the window of its own league is open: the buying club's window decides, so a club whose window has shut can still sell abroad. Players without a club follow the country's free-agent rule. Every country has a mid-year window (the European summer) and a start-of-year window (January); both are fixed day-of-year ranges, the closing day (deadline day) included.

Function Documentation

◆ canSignFreeAgent()

bool TransferWindows::canSignFreeAgent ( LeagueID  league,
const GameDateValue &  date 
)

True when a club of league can sign a player without a club.

◆ countries()

std::span< const CountryRules > TransferWindows::countries ( )

Every country with its own rules (leagues.json ids).

◆ isDeadlineDay()

bool TransferWindows::isDeadlineDay ( LeagueID  league,
const GameDateValue &  date 
)

True on the last day of a window of league.

◆ isOpen()

bool TransferWindows::isOpen ( LeagueID  league,
const GameDateValue &  date 
)

True when clubs of league can sign players from other clubs.

◆ isOpenAnywhere()

bool TransferWindows::isOpenAnywhere ( const GameDateValue &  date)

True when the window of at least one country is open.

◆ isStartOfYearWindow()

bool TransferWindows::isStartOfYearWindow ( LeagueID  league,
const GameDateValue &  date 
)

True on a day of the start-of-year (January) window of league.

◆ nextOpening()

GameDateValue TransferWindows::nextOpening ( LeagueID  league,
const GameDateValue &  date 
)

First day on or after date on which the window of league is open.

◆ rulesFor()

const CountryRules & TransferWindows::rulesFor ( LeagueID  league)

Rules of league's country; a common European calendar otherwise.

◆ windowEnd()

std::optional< GameDateValue > TransferWindows::windowEnd ( LeagueID  league,
const GameDateValue &  date 
)

Deadline day (last open day) of the window open on date; nullopt when the window of league is shut.

Variable Documentation

◆ FREE_AGENTS_ANY_TIME

constexpr std::int16_t TransferWindows::FREE_AGENTS_ANY_TIME = -1
inlineconstexpr

Free agents can join on any day of the year.