Player12
An open source football management simulator
Loading...
Searching...
No Matches
injury.h File Reference
#include <cstdint>

Go to the source code of this file.

Classes

struct  Injury
 A drawn injury. More...
 

Namespaces

namespace  InjuryModel
 

Enumerations

enum class  InjuryType : std::uint8_t {
  None = 0 , HamstringStrain , HamstringTightness , GroinStrain ,
  AnkleSprain , QuadricepsStrain , CalfStrain , KneeMcl ,
  ThighContusion , AchillesTendinopathy , Concussion , KneeCartilage ,
  KneeMeniscus , KneeAcl , BackSpasm , FootContusion ,
  BrokenMetatarsal , ShoulderDislocation , COUNT
}
 Diagnoses used by the injury model (values are persisted). More...
 
enum class  InjurySeverity : std::uint8_t { Minor , Moderate , Major }
 Severity bands used by UEFA injury studies. More...
 
enum class  InjuryContext : std::uint8_t { Match , Training }
 Where an injury happened; changes the diagnosis mix. More...
 

Functions

const char * InjuryModel::nameKey (InjuryType type)
 
bool InjuryModel::isMuscle (InjuryType type)
 
InjurySeverity InjuryModel::severity (std::uint16_t days)
 
Injury InjuryModel::draw (WorldRng &rng, InjuryContext context, InjuryType previous, bool recent_previous)
 
float InjuryModel::aggravationMultiplier (InjurySeverity severity)
 
double InjuryModel::aggravationChance (std::uint16_t days_left, int minutes)
 
Injury InjuryModel::aggravate (WorldRng &rng, InjuryType type, std::uint16_t days_left)
 

Enumeration Type Documentation

◆ InjuryContext

enum class InjuryContext : std::uint8_t
strong

Where an injury happened; changes the diagnosis mix.

Enumerator
Match 
Training 

◆ InjurySeverity

enum class InjurySeverity : std::uint8_t
strong

Severity bands used by UEFA injury studies.

Enumerator
Minor 

Up to 7 days.

Moderate 

8 to 28 days.

Major 

More than 28 days.

◆ InjuryType

enum class InjuryType : std::uint8_t
strong

Diagnoses used by the injury model (values are persisted).

Enumerator
None 
HamstringStrain 
HamstringTightness 
GroinStrain 
AnkleSprain 
QuadricepsStrain 
CalfStrain 
KneeMcl 
ThighContusion 
AchillesTendinopathy 
Concussion 
KneeCartilage 
KneeMeniscus 
KneeAcl 
BackSpasm 
FootContusion 
BrokenMetatarsal 
ShoulderDislocation 
COUNT