Player12
An open source football management simulator
Loading...
Searching...
No Matches
NationalManagement Class Reference

National-team jobs of the human manager: vacancies, applications and offers, the job itself (results, reputation, qualification, contract) and the AI head coaches who fill the other vacancies. More...

#include <national_job.h>

Classes

struct  QueuedFinals
 
struct  QueuedResult
 

Public Member Functions

 NationalManagement (std::shared_ptr< GameData > gamedata)
 
bool hasJob () const
 
const NationalJob & getJob () const
 
const std::vector< NationalStint > & getHistory () const
 
const std::vector< NationalVacancy > & getVacancies () const
 
const std::vector< NationalApplication > & getApplications () const
 
const std::vector< NationalJobOffer > & getOffers () const
 
const NationalApplication * findApplication (Language nation) const
 
const NationalJobOffer * findOffer (std::uint32_t offer_id) const
 
float stature (const NationalTeams &teams, Language nation) const
 
float applicationChance (const NationalTeams &teams, const ManagerProfile &profile, Language nation) const
 
NationalApplyResult apply (Language nation, const GameDateValue &date, const ManagerProfile &profile, bool club_job)
 
bool decline (std::uint32_t offer_id)
 
NationalApplyResult accept (std::uint32_t offer_id, const GameDateValue &date, NationalTeams &teams, ManagerCareer &career, bool club_job, Inbox &inbox)
 
void leave (DepartureReason reason, const GameDateValue &date, NationalTeams &teams, ManagerCareer &career, Inbox &inbox)
 
void openVacancy (Language nation, const GameDateValue &date)
 
void queueResult (const International::Fixture &fixture, double home_expected)
 
void queueFinals (const NationalTeams::Finals &finals, bool decided)
 
NationalDayEvents onDay (const GameDateValue &date, NationalTeams &teams, ManagerCareer &career, bool club_job, Inbox &inbox)
 
void load (const std::shared_ptr< DatabaseConnection > &db_conn)
 
void save (const std::shared_ptr< DatabaseConnection > &db_conn) const
 

Private Member Functions

void handleResult (const QueuedResult &queued, const GameDateValue &date, ManagerCareer &career, Inbox &inbox)
 
void handleFinals (const QueuedFinals &queued, const GameDateValue &date, NationalTeams &teams, ManagerCareer &career, Inbox &inbox, NationalDayEvents &events)
 
void fillVacancies (const GameDateValue &date, NationalTeams &teams)
 
void processApplications (const GameDateValue &date, const NationalTeams &teams, const ManagerProfile &profile, Inbox &inbox, NationalDayEvents &events)
 
void approach (const GameDateValue &date, const NationalTeams &teams, const ManagerProfile &profile, bool club_job, Inbox &inbox, NationalDayEvents &events)
 
void makeOffer (Language nation, const GameDateValue &date, const NationalTeams &teams, bool unsolicited, Inbox &inbox)
 
void reviewContract (const GameDateValue &date, NationalTeams &teams, ManagerCareer &career, Inbox &inbox, NationalDayEvents &events)
 
std::string aiCoachName (Language nation, const GameDateValue &date) const
 
bool recentlyLeft (Language nation, const GameDateValue &date) const
 

Private Attributes

std::shared_ptr< GameData > gamedata
 
NationalJob job
 
std::vector< NationalStint > history
 
std::vector< NationalVacancy > vacancies
 
std::vector< NationalApplication > applications
 
std::vector< NationalJobOffer > offers
 
std::vector< QueuedResult > queued_results
 
std::vector< QueuedFinals > queued_finals
 
std::uint32_t next_offer_id = 1
 

Detailed Description

National-team jobs of the human manager: vacancies, applications and offers, the job itself (results, reputation, qualification, contract) and the AI head coaches who fill the other vacancies.

Owned by Game next to the manager career. The national teams' calendar is unchanged: the manager's nation plays its qualifiers, nations league and finals through NationalTeams, with the squad he picks during the week before each window (the assistant's selection stands otherwise). Results and finals reach this class through NationalTeams' sinks and are handled on the same day by onDay().

Constructor & Destructor Documentation

◆ NationalManagement()

NationalManagement::NationalManagement ( std::shared_ptr< GameData >  gamedata)
explicit

Member Function Documentation

◆ accept()

NationalApplyResult NationalManagement::accept ( std::uint32_t  offer_id,
const GameDateValue &  date,
NationalTeams &  teams,
ManagerCareer &  career,
bool  club_job,
Inbox &  inbox 
)

Takes the job of a valid offer.

◆ aiCoachName()

std::string NationalManagement::aiCoachName ( Language  nation,
const GameDateValue &  date 
) const
private

◆ applicationChance()

float NationalManagement::applicationChance ( const NationalTeams &  teams,
const ManagerProfile &  profile,
Language  nation 
) const

Chance that nation's federation offers him the job.

◆ apply()

NationalApplyResult NationalManagement::apply ( Language  nation,
const GameDateValue &  date,
const ManagerProfile &  profile,
bool  club_job 
)

◆ approach()

void NationalManagement::approach ( const GameDateValue &  date,
const NationalTeams &  teams,
const ManagerProfile &  profile,
bool  club_job,
Inbox &  inbox,
NationalDayEvents &  events 
)
private

◆ decline()

bool NationalManagement::decline ( std::uint32_t  offer_id)

◆ fillVacancies()

void NationalManagement::fillVacancies ( const GameDateValue &  date,
NationalTeams &  teams 
)
private

◆ findApplication()

const NationalApplication * NationalManagement::findApplication ( Language  nation) const

◆ findOffer()

const NationalJobOffer * NationalManagement::findOffer ( std::uint32_t  offer_id) const

◆ getApplications()

const std::vector< NationalApplication > & NationalManagement::getApplications ( ) const
inline

◆ getHistory()

const std::vector< NationalStint > & NationalManagement::getHistory ( ) const
inline

◆ getJob()

const NationalJob & NationalManagement::getJob ( ) const
inline

◆ getOffers()

const std::vector< NationalJobOffer > & NationalManagement::getOffers ( ) const
inline

◆ getVacancies()

const std::vector< NationalVacancy > & NationalManagement::getVacancies ( ) const
inline

◆ handleFinals()

void NationalManagement::handleFinals ( const QueuedFinals &  queued,
const GameDateValue &  date,
NationalTeams &  teams,
ManagerCareer &  career,
Inbox &  inbox,
NationalDayEvents &  events 
)
private

◆ handleResult()

void NationalManagement::handleResult ( const QueuedResult &  queued,
const GameDateValue &  date,
ManagerCareer &  career,
Inbox &  inbox 
)
private

◆ hasJob()

bool NationalManagement::hasJob ( ) const
inline

◆ leave()

void NationalManagement::leave ( DepartureReason  reason,
const GameDateValue &  date,
NationalTeams &  teams,
ManagerCareer &  career,
Inbox &  inbox 
)

Leaves the national team; the federation appoints an AI coach later.

◆ load()

void NationalManagement::load ( const std::shared_ptr< DatabaseConnection > &  db_conn)

◆ makeOffer()

void NationalManagement::makeOffer ( Language  nation,
const GameDateValue &  date,
const NationalTeams &  teams,
bool  unsolicited,
Inbox &  inbox 
)
private

◆ onDay()

NationalDayEvents NationalManagement::onDay ( const GameDateValue &  date,
NationalTeams &  teams,
ManagerCareer &  career,
bool  club_job,
Inbox &  inbox 
)

After the national teams' day: results, finals, call-up notices, vacancies, applications, offers, wages and the contract.

◆ openVacancy()

void NationalManagement::openVacancy ( Language  nation,
const GameDateValue &  date 
)

A federation parts with its coach and looks for a new one (no-op when the nation already has a vacancy).

◆ processApplications()

void NationalManagement::processApplications ( const GameDateValue &  date,
const NationalTeams &  teams,
const ManagerProfile &  profile,
Inbox &  inbox,
NationalDayEvents &  events 
)
private

◆ queueFinals()

void NationalManagement::queueFinals ( const NationalTeams::Finals &  finals,
bool  decided 
)

◆ queueResult()

void NationalManagement::queueResult ( const International::Fixture &  fixture,
double  home_expected 
)

NationalTeams' sinks: queued and handled by onDay().

◆ recentlyLeft()

bool NationalManagement::recentlyLeft ( Language  nation,
const GameDateValue &  date 
) const
private

◆ reviewContract()

void NationalManagement::reviewContract ( const GameDateValue &  date,
NationalTeams &  teams,
ManagerCareer &  career,
Inbox &  inbox,
NationalDayEvents &  events 
)
private

◆ save()

void NationalManagement::save ( const std::shared_ptr< DatabaseConnection > &  db_conn) const

◆ stature()

float NationalManagement::stature ( const NationalTeams &  teams,
Language  nation 
) const

Stature of nation's job (0 when it has no national team).

Member Data Documentation

◆ applications

std::vector<NationalApplication> NationalManagement::applications
private

◆ gamedata

std::shared_ptr<GameData> NationalManagement::gamedata
private

◆ history

std::vector<NationalStint> NationalManagement::history
private

◆ job

NationalJob NationalManagement::job
private

◆ next_offer_id

std::uint32_t NationalManagement::next_offer_id = 1
private

◆ offers

std::vector<NationalJobOffer> NationalManagement::offers
private

◆ queued_finals

std::vector<QueuedFinals> NationalManagement::queued_finals
private

◆ queued_results

std::vector<QueuedResult> NationalManagement::queued_results
private

◆ vacancies

std::vector<NationalVacancy> NationalManagement::vacancies
private

The documentation for this class was generated from the following files: