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

Per-career state of the guidance features: first-week checklist, delegation policy, opposition instructions and the analytics snapshots of the managed club's matches. More...

#include <guidance.h>

Public Member Functions

void addSnapshot (ManagedMatchSnapshot snapshot)
 
const std::vector< ManagedMatchSnapshot > & getSnapshots () const
 
bool wasStored () const
 
void load (const std::shared_ptr< DatabaseConnection > &db_conn)
 
void save (const std::shared_ptr< DatabaseConnection > &db_conn) const
 
void onSaved ()
 

Public Attributes

OnboardingState onboarding
 
DelegationPolicy delegation
 
OppositionPlan opposition
 

Static Public Attributes

static constexpr std::size_t MAX_SNAPSHOTS = 130
 

Private Attributes

std::vector< ManagedMatchSnapshot > snapshots
 
std::size_t unsaved_from = 0
 
bool pruned = false
 
bool stored = false
 

Detailed Description

Per-career state of the guidance features: first-week checklist, delegation policy, opposition instructions and the analytics snapshots of the managed club's matches.

Persisted in GuidanceState, DelegatedDuties, OppositionInstructions and ManagedMatchAnalytics (assets/db/schema.sql) inside the game's save transaction.

Member Function Documentation

◆ addSnapshot()

void CareerGuidance::addSnapshot ( ManagedMatchSnapshot  snapshot)

Adds (or replaces the same fixture's) match snapshot.

◆ getSnapshots()

const std::vector< ManagedMatchSnapshot > & CareerGuidance::getSnapshots ( ) const
inline

◆ load()

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

◆ onSaved()

void CareerGuidance::onSaved ( )

Marks the snapshots as persisted after a successful commit.

◆ save()

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

Writes the state; must run inside the caller's transaction.

◆ wasStored()

bool CareerGuidance::wasStored ( ) const
inline

False for careers saved before the guidance features existed.

Member Data Documentation

◆ delegation

DelegationPolicy CareerGuidance::delegation

◆ MAX_SNAPSHOTS

constexpr std::size_t CareerGuidance::MAX_SNAPSHOTS = 130
staticconstexpr

Snapshots kept (oldest dropped): about two seasons of matches.

◆ onboarding

OnboardingState CareerGuidance::onboarding

◆ opposition

OppositionPlan CareerGuidance::opposition

◆ pruned

bool CareerGuidance::pruned = false
private

Old snapshots were dropped since the last save.

◆ snapshots

std::vector<ManagedMatchSnapshot> CareerGuidance::snapshots
private

◆ stored

bool CareerGuidance::stored = false
private

◆ unsaved_from

std::size_t CareerGuidance::unsaved_from = 0
private

Snapshots from this index on are not in the database yet.


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