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

#include <match_engine.h>

Public Attributes

Vector2F position {MatchTuning::Pitch::CENTRE, MatchTuning::Pitch::CENTRE}
 
float z = 0.0f
 
Vector2F velocity {0.0f, 0.0f}
 
float velocityZ = 0.0f
 
float curve = 0.0f
 
const Player * possessedBy = nullptr
 
const Player * lastPossessor = nullptr
 
const Player * intendedReceiver = nullptr
 
const Player * kicker = nullptr
 
float kickerLockout = 0.0f
 
std::uint32_t touchAttempts = 0
 
float dribbleExposure = 0.0f
 
float dribbleTouchLength = 0.0f
 
Vector2F dribbleDirection {1.0f, 0.0f}
 
float touchTimer = 0.0f
 
bool isPass = false
 
bool passByHome = false
 
bool passWasOffside = false
 
bool isShot = false
 
bool shotByHome = false
 
bool shotOnTarget = false
 
float shotXG = 0.0f
 
float shotTargetY = MatchTuning::Pitch::CENTRE
 
float shotTargetHeightMetres = 0.0f
 
float shotElapsedSeconds = 0.0f
 
bool shotIsHeader = false
 
bool shotIsPenalty = false
 
bool shotFromSetPiece = false
 
bool shotSaveResolved = false
 
bool isAerialDelivery = false
 
bool fromThrowIn = false
 

Detailed Description

The ball. position is normalised; z is the height in length units (z * MatchTuning::Units::BALL_Z_METRES = metres) for renderers. Velocities are in m/s and curve is the heading rotation rate in rad/s.

Member Data Documentation

◆ curve

float MatchBall::curve = 0.0f

◆ dribbleDirection

Vector2F MatchBall::dribbleDirection {1.0f, 0.0f}

◆ dribbleExposure

float MatchBall::dribbleExposure = 0.0f

While dribbled: metres ahead of the carrier's feet and the metric direction of the last touch.

◆ dribbleTouchLength

float MatchBall::dribbleTouchLength = 0.0f

◆ fromThrowIn

bool MatchBall::fromThrowIn = false

Thrown in and untouched since: it cannot score directly.

◆ intendedReceiver

const Player* MatchBall::intendedReceiver = nullptr

◆ isAerialDelivery

bool MatchBall::isAerialDelivery = false

Lofted delivery (cross, corner, long ball) that can be contested.

◆ isPass

bool MatchBall::isPass = false

◆ isShot

bool MatchBall::isShot = false

◆ kicker

const Player* MatchBall::kicker = nullptr

The player who last kicked or deflected the ball.

◆ kickerLockout

float MatchBall::kickerLockout = 0.0f

Seconds during which the kicker cannot touch the ball again.

◆ lastPossessor

const Player* MatchBall::lastPossessor = nullptr

◆ passByHome

bool MatchBall::passByHome = false

◆ passWasOffside

bool MatchBall::passWasOffside = false

◆ position

◆ possessedBy

const Player* MatchBall::possessedBy = nullptr

◆ shotByHome

bool MatchBall::shotByHome = false

◆ shotElapsedSeconds

float MatchBall::shotElapsedSeconds = 0.0f

◆ shotFromSetPiece

bool MatchBall::shotFromSetPiece = false

◆ shotIsHeader

bool MatchBall::shotIsHeader = false

◆ shotIsPenalty

bool MatchBall::shotIsPenalty = false

◆ shotOnTarget

bool MatchBall::shotOnTarget = false

Whether the shot's flight crosses the goal line inside the frame.

◆ shotSaveResolved

bool MatchBall::shotSaveResolved = false

◆ shotTargetHeightMetres

float MatchBall::shotTargetHeightMetres = 0.0f

◆ shotTargetY

float MatchBall::shotTargetY = MatchTuning::Pitch::CENTRE

Predicted goal-line crossing of the current shot (y and metres high).

◆ shotXG

float MatchBall::shotXG = 0.0f

◆ touchAttempts

std::uint32_t MatchBall::touchAttempts = 0

Players (by slot bit) who already tried to reach this ball in flight.

◆ touchTimer

float MatchBall::touchTimer = 0.0f

◆ velocity

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

◆ velocityZ

float MatchBall::velocityZ = 0.0f

◆ z

float MatchBall::z = 0.0f

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