Player12
An open source football management simulator
Loading...
Searching...
No Matches
PlayerView Namespace Reference

Cached, display-ready player data for tables and profiles. More...

Classes

struct  AttributeGroup
 Stats shown together on the profile. More...
 
struct  PlayerRow
 One table row. More...
 
struct  RoleFit
 Suitability of a player for one broad position group. More...
 

Enumerations

enum class  PositionGroup : uint8_t { GOALKEEPER , DEFENDER , MIDFIELDER , FORWARD }
 Broad positional group used for filters and colouring. More...
 

Functions

PlayerRow makeRow (const GameController &controller, const Player &player)
 Builds a display row for a player.
 
PositionGroup groupOf (PlayerRole role)
 Broad group of a role.
 
const char * groupKey (PositionGroup group)
 Localisation key for a position group (short label).
 
std::vector< RoleFit > roleFits (const Player &player, const StatsConfig &config)
 Rates the player in every broad position group with the same role-focus weights used for the overall rating, best first.
 
std::string statLabel (std::string_view statName)
 Localised name of a player attribute (falls back to the raw name).
 
std::string toLower (std::string_view text)
 Lower-cases ASCII text for case-insensitive search.
 

Variables

constexpr std::array< AttributeGroup, 3 > ATTRIBUTE_GROUPS
 Attribute grouping for the profile screen.
 

Detailed Description

Cached, display-ready player data for tables and profiles.

Rows are built once per refresh so rendering never recomputes overalls, market values or formatted strings per frame.

Enumeration Type Documentation

◆ PositionGroup

enum class PlayerView::PositionGroup : uint8_t
strong

Broad positional group used for filters and colouring.

Enumerator
GOALKEEPER 
DEFENDER 
MIDFIELDER 
FORWARD 

Function Documentation

◆ groupKey()

const char * PlayerView::groupKey ( PositionGroup  group)

Localisation key for a position group (short label).

◆ groupOf()

PositionGroup PlayerView::groupOf ( PlayerRole  role)

Broad group of a role.

◆ makeRow()

PlayerRow PlayerView::makeRow ( const GameController &  controller,
const Player &  player 
)

Builds a display row for a player.

◆ roleFits()

std::vector< RoleFit > PlayerView::roleFits ( const Player &  player,
const StatsConfig &  config 
)

Rates the player in every broad position group with the same role-focus weights used for the overall rating, best first.

◆ statLabel()

std::string PlayerView::statLabel ( std::string_view  statName)

Localised name of a player attribute (falls back to the raw name).

◆ toLower()

std::string PlayerView::toLower ( std::string_view  text)

Lower-cases ASCII text for case-insensitive search.

Variable Documentation

◆ ATTRIBUTE_GROUPS

constexpr std::array<AttributeGroup, 3> PlayerView::ATTRIBUTE_GROUPS
constexpr
Initial value:
= {{
{"PROFILE_GROUP_TECHNICAL", {"Shooting", "Passing", "Dribbling"}},
{"PROFILE_GROUP_PHYSICAL", {"Pace", "Physicality", "Stamina"}},
{"PROFILE_GROUP_TACTICAL", {"Vision", "Defending", "Goalkeeping"}},
}}

Attribute grouping for the profile screen.