Player12
An open source football management simulator
Loading...
Searching...
No Matches
medical_centre.h File Reference
#include <array>
#include <cstdint>
#include <memory>
#include <unordered_map>
#include <vector>
#include "global/types.h"
#include "model/gamedate.h"
#include "model/injury.h"
#include "model/staff.h"
#include "model/training.h"

Go to the source code of this file.

Classes

struct  ReturnWindow
 Days until a player is expected back (inclusive range). More...
 
struct  InjuryRiskInputs
 Observable facts behind a player's injury risk. More...
 
struct  InjuryRiskAssessment
 
struct  MedicalInjuryRow
 One injured player of the managed squad. More...
 
struct  MedicalRiskRow
 Fitness and injury risk of one available player. More...
 
struct  MedicalReport
 The managed club's medical centre: who is out, who is at risk and what the medical staff contributes. More...
 
struct  LoadChartDay
 One day of a player's load chart. More...
 
class  MedicalDesk
 The medical staff's day-to-day work for the managed club: rest and minute-limit instructions, the 28-day load log behind the load chart, aggravated injuries of players who play through pain and the staff's warnings in the inbox. More...
 
struct  MedicalDesk::LoadLog
 

Namespaces

namespace  MedicalCentre
 

Enumerations

enum class  RiskBand : std::uint8_t { Low , Moderate , High }
 Three-step risk band shown by the medical centre. More...
 
enum  RiskReason : std::uint8_t {
  RISK_REASON_NONE = 0 , RISK_REASON_AGE = 1 << 0 , RISK_REASON_CONGESTION = 1 << 1 , RISK_REASON_RECENT_INJURY = 1 << 2 ,
  RISK_REASON_FATIGUE = 1 << 3 , RISK_REASON_WORKLOAD = 1 << 4
}
 Why a risk is raised (bit flags). More...
 
enum  MedicalFlag : std::uint8_t { MEDICAL_FLAG_NONE = 0 , MEDICAL_FLAG_REST = 1 << 0 , MEDICAL_FLAG_LIMIT_MINUTES = 1 << 1 }
 Instructions of the medical staff for one player (bit flags, persisted). More...
 

Functions

float MedicalCentre::staffQuality (const StaffEffects &effects)
 
ReturnWindow MedicalCentre::returnWindow (std::uint16_t days_left, float staff_quality)
 
RiskBand MedicalCentre::reinjuryRisk (InjuryType type, std::uint16_t days_left, int age)
 
InjuryRiskAssessment MedicalCentre::assess (const InjuryRiskInputs &inputs)
 
const char * MedicalCentre::bandKey (RiskBand band)
 
RiskBand MedicalCentre::loadBand (float ratio)
 
bool MedicalCentre::substitutionDue (std::uint8_t flags, int minute)
 

Variables

constexpr int MedicalCentre::RECURRENCE_WINDOW_DAYS = 60
 
constexpr int MedicalCentre::LOAD_CHART_DAYS = 28
 
constexpr int MedicalCentre::MINUTE_LIMIT = 60
 
constexpr float MedicalCentre::LOAD_ZONE_LOW = 0.8f
 
constexpr float MedicalCentre::LOAD_ZONE_HIGH = 1.3f
 
constexpr float MedicalCentre::LOAD_SPIKE = 1.5f
 

Enumeration Type Documentation

◆ MedicalFlag

enum MedicalFlag : std::uint8_t

Instructions of the medical staff for one player (bit flags, persisted).

Enumerator
MEDICAL_FLAG_NONE 
MEDICAL_FLAG_REST 

Left out of the assistant's selections while anyone else is fit.

MEDICAL_FLAG_LIMIT_MINUTES 

Should come off around the hour mark.

◆ RiskBand

enum class RiskBand : std::uint8_t
strong

Three-step risk band shown by the medical centre.

Enumerator
Low 
Moderate 
High 

◆ RiskReason

enum RiskReason : std::uint8_t

Why a risk is raised (bit flags).

Enumerator
RISK_REASON_NONE 
RISK_REASON_AGE 
RISK_REASON_CONGESTION 
RISK_REASON_RECENT_INJURY 
RISK_REASON_FATIGUE 
RISK_REASON_WORKLOAD