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

Mentoring groups of the managed club. More...

#include <mentoring.h>

Public Member Functions

MentoringError createGroup (const GameData &gamedata, TeamID team_id, PlayerID mentor_id, std::uint32_t *id=nullptr)
 
MentoringError addMentee (const GameData &gamedata, std::uint32_t group_id, PlayerID mentee_id)
 
MentoringError removeMentee (std::uint32_t group_id, PlayerID mentee_id)
 
MentoringError dissolve (std::uint32_t group_id)
 
void onWeek (GameData &gamedata)
 
float developmentMultiplier (const GameData &gamedata, PlayerID player_id) const
 
std::vector< MentoringGroup > groupsFor (TeamID team_id) const
 
const MentoringGroup * groupOf (PlayerID player_id) const
 
void clear ()
 
void load (const std::shared_ptr< DatabaseConnection > &db_conn)
 
void save (const std::shared_ptr< DatabaseConnection > &db_conn) const
 

Private Member Functions

MentoringGroup * find (std::uint32_t group_id)
 
void prune (const GameData &gamedata)
 

Private Attributes

std::vector< MentoringGroup > all
 
std::uint32_t next_id = 1
 

Detailed Description

Mentoring groups of the managed club.

Groups lapse on their own when a member leaves the club or a youngster outgrows the scheme.

Member Function Documentation

◆ addMentee()

MentoringError MentoringSystem::addMentee ( const GameData &  gamedata,
std::uint32_t  group_id,
PlayerID  mentee_id 
)

◆ clear()

void MentoringSystem::clear ( )

◆ createGroup()

MentoringError MentoringSystem::createGroup ( const GameData &  gamedata,
TeamID  team_id,
PlayerID  mentor_id,
std::uint32_t *  id = nullptr 
)

Creates a group led by mentor_id; returns its id through id.

◆ developmentMultiplier()

float MentoringSystem::developmentMultiplier ( const GameData &  gamedata,
PlayerID  player_id 
) const

Development multiplier of a player (1.0 when not mentored).

◆ dissolve()

MentoringError MentoringSystem::dissolve ( std::uint32_t  group_id)

◆ find()

MentoringGroup * MentoringSystem::find ( std::uint32_t  group_id)
private

◆ groupOf()

const MentoringGroup * MentoringSystem::groupOf ( PlayerID  player_id) const

Group containing a player as mentor or mentee (nullptr if none).

◆ groupsFor()

std::vector< MentoringGroup > MentoringSystem::groupsFor ( TeamID  team_id) const

◆ load()

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

◆ onWeek()

void MentoringSystem::onWeek ( GameData &  gamedata)

Weekly nudges, morale and pruning of lapsed memberships.

◆ prune()

void MentoringSystem::prune ( const GameData &  gamedata)
private

◆ removeMentee()

MentoringError MentoringSystem::removeMentee ( std::uint32_t  group_id,
PlayerID  mentee_id 
)

◆ save()

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

Member Data Documentation

◆ all

std::vector<MentoringGroup> MentoringSystem::all
private

◆ next_id

std::uint32_t MentoringSystem::next_id = 1
private

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