Player12
An open source football management simulator
Loading...
Searching...
No Matches
MatchPlayer Struct Reference

#include <match_engine.h>

Public Attributes

const Player * player = nullptr
 
bool isHomeTeam = false
 
Vector2F position {MatchTuning::Pitch::CENTRE, MatchTuning::Pitch::CENTRE}
 
Vector2F velocity {0.0f, 0.0f}
 
Vector2F basePosition {MatchTuning::Pitch::CENTRE, MatchTuning::Pitch::CENTRE}
 
Vector2F movementTarget
 
PlayerIntent intent = PlayerIntent::HOLD_SHAPE
 
Vector2F tacticalTarget
 
bool urgentMovement = false
 
float facingAngle = 0.0f
 
float targetAngle = 0.0f
 
float turnRate = MatchTuning::Player::FACING_TURN_RATE_RADIANS
 
bool isTrapping = false
 
float trapTimer = 0.0f
 
bool isDiving = false
 
float diveTimer = 0.0f
 
bool isPressing = false
 
bool isMakingRun = false
 
float stamina = 1.0f
 
float sprintReserve = 1.0f
 
float maxSpeed = MatchTuning::Player::TOP_SPEED_BASE
 
float acceleration = MatchTuning::Player::ACCELERATION_BASE
 
float braking = MatchTuning::Player::BRAKING_BASE
 
bool isSprinting = false
 
float tackleCooldown = 0.0f
 
float actionCooldown = 0.0f
 
float pace = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float shooting = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float passing = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float dribbling = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float defending = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float goalkeeping = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float physicality = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float endurance = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float vision = MatchTuning::Player::DEFAULT_ATTRIBUTE
 
float heightMetres = MatchTuning::Units::DEFAULT_PLAYER_HEIGHT_METRES
 
bool onPitch = true
 
bool isGoalkeeper = false
 
bool isInjured = false
 
std::int8_t formationSlot = -1
 
int yellowCards = 0
 
std::size_t statsIndex = 0
 

Detailed Description

One on-pitch slot. position, basePosition and movementTarget are normalised pitch coordinates; velocity is in metres per second (x along the length, y across the width). facingAngle is the heading in normalised pitch space, as renderers expect.

Member Data Documentation

◆ acceleration

float MatchPlayer::acceleration = MatchTuning::Player::ACCELERATION_BASE

◆ actionCooldown

float MatchPlayer::actionCooldown = 0.0f

◆ basePosition

◆ braking

float MatchPlayer::braking = MatchTuning::Player::BRAKING_BASE

◆ defending

float MatchPlayer::defending = MatchTuning::Player::DEFAULT_ATTRIBUTE

◆ diveTimer

float MatchPlayer::diveTimer = 0.0f

◆ dribbling

float MatchPlayer::dribbling = MatchTuning::Player::DEFAULT_ATTRIBUTE

◆ endurance

float MatchPlayer::endurance = MatchTuning::Player::DEFAULT_ATTRIBUTE

Stamina attribute (endurance); stamina above is the live condition.

◆ facingAngle

float MatchPlayer::facingAngle = 0.0f

◆ formationSlot

std::int8_t MatchPlayer::formationSlot = -1

Outfield slot of the side's formation (see MatchEngine::getFormation); -1 for the starting goalkeeper. Ignored while keeping goal.

◆ goalkeeping

float MatchPlayer::goalkeeping = MatchTuning::Player::DEFAULT_ATTRIBUTE

◆ heightMetres

float MatchPlayer::heightMetres = MatchTuning::Units::DEFAULT_PLAYER_HEIGHT_METRES

◆ intent

PlayerIntent MatchPlayer::intent = PlayerIntent::HOLD_SHAPE

◆ isDiving

bool MatchPlayer::isDiving = false

◆ isGoalkeeper

bool MatchPlayer::isGoalkeeper = false

Goalkeeper duties (the natural keeper, or an emergency replacement).

◆ isHomeTeam

bool MatchPlayer::isHomeTeam = false

◆ isInjured

bool MatchPlayer::isInjured = false

◆ isMakingRun

bool MatchPlayer::isMakingRun = false

◆ isPressing

bool MatchPlayer::isPressing = false

◆ isSprinting

bool MatchPlayer::isSprinting = false

◆ isTrapping

bool MatchPlayer::isTrapping = false

◆ maxSpeed

float MatchPlayer::maxSpeed = MatchTuning::Player::TOP_SPEED_BASE

Fresh top speed (m/s), maximum acceleration A0 and braking (m/s^2).

◆ movementTarget

Vector2F MatchPlayer::movementTarget
Initial value:
static constexpr float CENTRE
Definition match_tuning.h:37

◆ onPitch

bool MatchPlayer::onPitch = true

False once sent off or forced off injured with no substitute left.

◆ pace

float MatchPlayer::pace = MatchTuning::Player::DEFAULT_ATTRIBUTE

◆ passing

float MatchPlayer::passing = MatchTuning::Player::DEFAULT_ATTRIBUTE

◆ physicality

float MatchPlayer::physicality = MatchTuning::Player::DEFAULT_ATTRIBUTE

◆ player

const Player* MatchPlayer::player = nullptr

◆ position

◆ shooting

float MatchPlayer::shooting = MatchTuning::Player::DEFAULT_ATTRIBUTE

◆ sprintReserve

float MatchPlayer::sprintReserve = 1.0f

Fast repeat-sprint reserve in [0, 1].

◆ stamina

float MatchPlayer::stamina = 1.0f

Slow energy pool (match condition) in [MINIMUM_STAMINA, 1].

◆ statsIndex

std::size_t MatchPlayer::statsIndex = 0

Index into MatchEngine::getPlayerStats() for the current occupant.

◆ tackleCooldown

float MatchPlayer::tackleCooldown = 0.0f

◆ tacticalTarget

Vector2F MatchPlayer::tacticalTarget
Initial value:

Latest tactical target (refreshed at the tactical rate) and whether it is chased urgently.

◆ targetAngle

float MatchPlayer::targetAngle = 0.0f

◆ trapTimer

float MatchPlayer::trapTimer = 0.0f

◆ turnRate

float MatchPlayer::turnRate = MatchTuning::Player::FACING_TURN_RATE_RADIANS

◆ urgentMovement

bool MatchPlayer::urgentMovement = false

◆ velocity

Vector2F MatchPlayer::velocity {0.0f, 0.0f}

◆ vision

float MatchPlayer::vision = MatchTuning::Player::DEFAULT_ATTRIBUTE

◆ yellowCards

int MatchPlayer::yellowCards = 0

The documentation for this struct was generated from the following file: