13#include <unordered_map>
120 PlayerID mentor_id, std::uint32_t*
id =
nullptr);
138 void load(
const std::shared_ptr<DatabaseConnection>& db_conn);
139 void save(
const std::shared_ptr<DatabaseConnection>& db_conn)
const;
145 std::vector<MentoringGroup>
all;
Manages the SQLite database connection and transaction lifecycle.
Definition database_connection.h:24
Singleton class that acts as an in-memory cache for the database state.
Definition gamedata.h:43
Mentoring groups of the managed club.
Definition mentoring.h:116
std::vector< MentoringGroup > all
Definition mentoring.h:145
std::uint32_t next_id
Definition mentoring.h:146
MentoringError addMentee(const GameData &gamedata, std::uint32_t group_id, PlayerID mentee_id)
Definition mentoring.cpp:138
MentoringError dissolve(std::uint32_t group_id)
Definition mentoring.cpp:170
void prune(const GameData &gamedata)
Definition mentoring.cpp:178
std::vector< MentoringGroup > groupsFor(TeamID team_id) const
Definition mentoring.cpp:263
MentoringError removeMentee(std::uint32_t group_id, PlayerID mentee_id)
Definition mentoring.cpp:159
void clear()
Definition mentoring.cpp:275
MentoringGroup * find(std::uint32_t group_id)
Definition mentoring.cpp:99
void load(const std::shared_ptr< DatabaseConnection > &db_conn)
Definition mentoring.cpp:281
MentoringError createGroup(const GameData &gamedata, TeamID team_id, PlayerID mentor_id, std::uint32_t *id=nullptr)
Definition mentoring.cpp:117
float developmentMultiplier(const GameData &gamedata, PlayerID player_id) const
Definition mentoring.cpp:247
void save(const std::shared_ptr< DatabaseConnection > &db_conn) const
Definition mentoring.cpp:314
const MentoringGroup * groupOf(PlayerID player_id) const
Definition mentoring.cpp:105
void onWeek(GameData &gamedata)
Definition mentoring.cpp:199
Persistent career identity, attributes, traits and day-to-day state.
Definition player.h:104
MentoringError
Why a mentoring change was refused.
Definition mentoring.h:24
const char * mentoringErrorKey(MentoringError error)
Definition mentoring.cpp:32
Bounded, slow personality transfer from mentor to youngster.
Definition mentoring.cpp:64
float developmentMultiplier(std::uint8_t mentor_professionalism)
Definition mentoring.cpp:89
constexpr float WEEKLY_RATE
Definition mentoring.h:83
constexpr std::size_t MAX_MENTEES
Definition mentoring.h:81
constexpr float MAX_TOTAL_SHIFT
Definition mentoring.h:85
constexpr float MAX_WEEKLY_STEP
Definition mentoring.h:84
constexpr int MENTOR_MIN_AGE
Definition mentoring.h:79
float receptiveness(int age)
Definition mentoring.cpp:65
constexpr float MAX_DEVELOPMENT_BONUS
Definition mentoring.h:86
constexpr float GLOOM_PER_WEEK
Definition mentoring.h:89
float influence(int mentor_age)
Definition mentoring.cpp:71
constexpr float UNHAPPY_MENTOR_MORALE
Definition mentoring.h:88
float weeklyShift(float mentor_value, float mentee_value, float receptiveness, float influence, float already_shifted)
Definition mentoring.cpp:78
constexpr int MENTEE_MAX_AGE
Definition mentoring.h:80
One youngster in a mentoring group.
Definition mentoring.h:43
float temperament_shift
Definition mentoring.h:47
float professionalism_shift
Definition mentoring.h:46
float professionalism_pending
Definition mentoring.h:48
float temperament_pending
Definition mentoring.h:49
PlayerID player_id
Definition mentoring.h:44
A senior player guiding up to three youngsters.
Definition mentoring.h:54
PlayerID mentor_id
Definition mentoring.h:57
std::vector< MenteeState > mentees
Definition mentoring.h:58
TeamID team_id
Definition mentoring.h:56
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21