Player12
An open source football management simulator
Loading...
Searching...
No Matches
MatchRenderer2D::State Struct Reference

Public Member Functions

 State ()
 
ImVec2 atMetres (float x, float y) const
 
float px (float logicalPixels) const
 
void reserveBatch (int vertices, int indices)
 
void releaseBatch ()
 
void batchQuad (ImVec2 a, ImVec2 b, ImVec2 c, ImVec2 d, ImU32 ca, ImU32 cb, ImU32 cc, ImU32 cd)
 
void batchFan (ImVec2 centre, float radiusX, float radiusY, int segments, ImU32 inner, ImU32 outer, std::uint32_t salt)
 
void prepareMatch (const MatchRenderSnapshot &snapshot)
 
void buildGrassColors ()
 
void buildStands (float apron)
 
void updateBall (const MatchRenderSnapshot &snapshot, float alpha)
 
void updateEvents (const MatchRenderSnapshot &snapshot)
 
void detectKick (const MatchRenderSnapshot &snapshot)
 
void updateFlights (const MatchRenderSnapshot &snapshot)
 
void updatePressure (const MatchRenderSnapshot &snapshot, float alpha)
 
float defendingLine (const MatchRenderSnapshot &snapshot, bool attackersHome, float ballX) const
 
void drawStadium (float apron)
 
void drawGrass ()
 
void drawWear ()
 
void drawPressure ()
 
void drawMarkings ()
 
void drawGoal (bool left)
 
void drawOffside ()
 
void drawFlights ()
 
void drawTrail ()
 
void drawTokens (const MatchRenderSnapshot &snapshot, const MatchRenderOptions &options, float alpha)
 
void drawToken (const TokenOnScreen &token, float radius, bool hovered)
 
void drawBall ()
 

Public Attributes

MatchKits kits
 
TeamID homeTeam = 0
 
TeamID awayTeam = 0
 
bool kitsChosen = false
 
ImU32 homeOverlay = 0
 
ImU32 awayOverlay = 0
 
MatchShirtNumbers numbers
 
ImDrawList * drawList = nullptr
 
ImVec2 whitePixel
 
MatchViewport viewport
 
float ppm = 1.0f
 
float uiScale = 1.0f
 
float elapsedSeconds = 0.0f
 
float frameSeconds = 0.0f
 
bool reducedMotion = false
 
int batchVertices = 0
 
int batchIndices = 0
 
PathSample ball
 
float ballSpeed = 0.0f
 
ImVec2 ballDirection {1.0f, 0.0f}
 
float ballSpin = 0.0f
 
std::array< PathSample, Tuning::Ball::TRAIL_SAMPLES > trail {}
 
int trailNext = 0
 
float trailTimer = 0.0f
 
const Player * lastPossessor = nullptr
 
Vector2F lastBallPosition {-1.0f, -1.0f}
 
float lastBallStepSpeed = 0.0f
 
std::array< Flight, 2 > flights {}
 
std::size_t currentFlight = 0
 
float lineAtKick = -1.0f
 
bool kickByHome = false
 
std::size_t seenEvents = 0
 
bool eventsSeen = false
 
float offsideSeconds = -1.0f
 
float offsideX = 0.0f
 
std::array< float,(Tuning::Pressure::COLUMNS+1) *(Tuning::Pressure::ROWS+1)> pressure {}
 
bool pressureValid = false
 
std::vector< ImU32 > grassColors
 
std::vector< ImDrawVert > standQuads
 
float standWidth = 0.0f
 
float standHeight = 0.0f
 
float standApron = 0.0f
 
std::vector< TokenOnScreen > tokens
 

Constructor & Destructor Documentation

◆ State()

MatchRenderer2D::State::State ( )
inline

Member Function Documentation

◆ atMetres()

ImVec2 MatchRenderer2D::State::atMetres ( float  x,
float  y 
) const
inline

◆ batchFan()

void MatchRenderer2D::State::batchFan ( ImVec2  centre,
float  radiusX,
float  radiusY,
int  segments,
ImU32  inner,
ImU32  outer,
std::uint32_t  salt 
)

◆ batchQuad()

void MatchRenderer2D::State::batchQuad ( ImVec2  a,
ImVec2  b,
ImVec2  c,
ImVec2  d,
ImU32  ca,
ImU32  cb,
ImU32  cc,
ImU32  cd 
)

◆ buildGrassColors()

void MatchRenderer2D::State::buildGrassColors ( )

◆ buildStands()

void MatchRenderer2D::State::buildStands ( float  apron)

◆ defendingLine()

float MatchRenderer2D::State::defendingLine ( const MatchRenderSnapshot &  snapshot,
bool  attackersHome,
float  ballX 
) const

◆ detectKick()

void MatchRenderer2D::State::detectKick ( const MatchRenderSnapshot &  snapshot)

◆ drawBall()

void MatchRenderer2D::State::drawBall ( )

◆ drawFlights()

void MatchRenderer2D::State::drawFlights ( )

◆ drawGoal()

void MatchRenderer2D::State::drawGoal ( bool  left)

◆ drawGrass()

void MatchRenderer2D::State::drawGrass ( )

◆ drawMarkings()

void MatchRenderer2D::State::drawMarkings ( )

◆ drawOffside()

void MatchRenderer2D::State::drawOffside ( )

◆ drawPressure()

void MatchRenderer2D::State::drawPressure ( )

◆ drawStadium()

void MatchRenderer2D::State::drawStadium ( float  apron)

◆ drawToken()

void MatchRenderer2D::State::drawToken ( const TokenOnScreen &  token,
float  radius,
bool  hovered 
)

◆ drawTokens()

void MatchRenderer2D::State::drawTokens ( const MatchRenderSnapshot &  snapshot,
const MatchRenderOptions &  options,
float  alpha 
)

◆ drawTrail()

void MatchRenderer2D::State::drawTrail ( )

◆ drawWear()

void MatchRenderer2D::State::drawWear ( )

◆ prepareMatch()

void MatchRenderer2D::State::prepareMatch ( const MatchRenderSnapshot &  snapshot)

◆ px()

float MatchRenderer2D::State::px ( float  logicalPixels) const
inline

◆ releaseBatch()

void MatchRenderer2D::State::releaseBatch ( )

◆ reserveBatch()

void MatchRenderer2D::State::reserveBatch ( int  vertices,
int  indices 
)

◆ updateBall()

void MatchRenderer2D::State::updateBall ( const MatchRenderSnapshot &  snapshot,
float  alpha 
)

◆ updateEvents()

void MatchRenderer2D::State::updateEvents ( const MatchRenderSnapshot &  snapshot)

◆ updateFlights()

void MatchRenderer2D::State::updateFlights ( const MatchRenderSnapshot &  snapshot)

◆ updatePressure()

void MatchRenderer2D::State::updatePressure ( const MatchRenderSnapshot &  snapshot,
float  alpha 
)

Member Data Documentation

◆ awayOverlay

ImU32 MatchRenderer2D::State::awayOverlay = 0

◆ awayTeam

TeamID MatchRenderer2D::State::awayTeam = 0

◆ ball

PathSample MatchRenderer2D::State::ball

◆ ballDirection

ImVec2 MatchRenderer2D::State::ballDirection {1.0f, 0.0f}

◆ ballSpeed

float MatchRenderer2D::State::ballSpeed = 0.0f

◆ ballSpin

float MatchRenderer2D::State::ballSpin = 0.0f

◆ batchIndices

int MatchRenderer2D::State::batchIndices = 0

◆ batchVertices

int MatchRenderer2D::State::batchVertices = 0

◆ currentFlight

std::size_t MatchRenderer2D::State::currentFlight = 0

◆ drawList

ImDrawList* MatchRenderer2D::State::drawList = nullptr

◆ elapsedSeconds

float MatchRenderer2D::State::elapsedSeconds = 0.0f

◆ eventsSeen

bool MatchRenderer2D::State::eventsSeen = false

◆ flights

std::array<Flight, 2> MatchRenderer2D::State::flights {}

◆ frameSeconds

float MatchRenderer2D::State::frameSeconds = 0.0f

◆ grassColors

std::vector<ImU32> MatchRenderer2D::State::grassColors

Grass cell colours (fixed grid, built once).

◆ homeOverlay

ImU32 MatchRenderer2D::State::homeOverlay = 0

Token rings and overlay colours derived from the kits.

◆ homeTeam

TeamID MatchRenderer2D::State::homeTeam = 0

◆ kickByHome

bool MatchRenderer2D::State::kickByHome = false

◆ kits

MatchKits MatchRenderer2D::State::kits

◆ kitsChosen

bool MatchRenderer2D::State::kitsChosen = false

◆ lastBallPosition

Vector2F MatchRenderer2D::State::lastBallPosition {-1.0f, -1.0f}

◆ lastBallStepSpeed

float MatchRenderer2D::State::lastBallStepSpeed = 0.0f

◆ lastPossessor

const Player* MatchRenderer2D::State::lastPossessor = nullptr

◆ lineAtKick

float MatchRenderer2D::State::lineAtKick = -1.0f

Defending line (metres) when the last ball was struck, and by whom.

◆ numbers

MatchShirtNumbers MatchRenderer2D::State::numbers

◆ offsideSeconds

float MatchRenderer2D::State::offsideSeconds = -1.0f

◆ offsideX

float MatchRenderer2D::State::offsideX = 0.0f

◆ ppm

float MatchRenderer2D::State::ppm = 1.0f

◆ pressure

std::array<float, (Tuning::Pressure::COLUMNS + 1) * (Tuning::Pressure::ROWS + 1)> MatchRenderer2D::State::pressure {}

◆ pressureValid

bool MatchRenderer2D::State::pressureValid = false

◆ reducedMotion

bool MatchRenderer2D::State::reducedMotion = false

◆ seenEvents

std::size_t MatchRenderer2D::State::seenEvents = 0

◆ standApron

float MatchRenderer2D::State::standApron = 0.0f

◆ standHeight

float MatchRenderer2D::State::standHeight = 0.0f

◆ standQuads

std::vector<ImDrawVert> MatchRenderer2D::State::standQuads

Stand crowd and boards as quads relative to the viewport origin.

◆ standWidth

float MatchRenderer2D::State::standWidth = 0.0f

◆ tokens

std::vector<TokenOnScreen> MatchRenderer2D::State::tokens

◆ trail

std::array<PathSample, Tuning::Ball::TRAIL_SAMPLES> MatchRenderer2D::State::trail {}

◆ trailNext

int MatchRenderer2D::State::trailNext = 0

◆ trailTimer

float MatchRenderer2D::State::trailTimer = 0.0f

◆ uiScale

float MatchRenderer2D::State::uiScale = 1.0f

◆ viewport

MatchViewport MatchRenderer2D::State::viewport

◆ whitePixel

ImVec2 MatchRenderer2D::State::whitePixel

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