Utilities for handling player roles and their pitch mappings.
Definition role_utils.h:21
static const char * shortName(PlayerRole role)
Localised short position name for display ("GK", "POR"). The codes of toString() are for persistence ...
Definition role_utils.cpp:35
static std::string toString(PlayerRole role)
Converts a PlayerRole enum to its string representation.
Definition role_utils.cpp:54
static Vector2F getBaseCoordinate(PlayerRole role)
Gets the base pitch coordinate for a given role. Coordinates are normalized: X [0....
Definition role_utils.cpp:113
static PlayerRole fromString(std::string_view role_str)
Converts a string to a PlayerRole enum.
Definition role_utils.cpp:88
static std::string getBroadCategory(PlayerRole role)
Gets the broad category of the role (e.g. "Striker", "Defender"). Used for backward compatibility wit...
Definition role_utils.cpp:149
static std::string shortNameArg(PlayerRole role)
Inbox argument for the short name ("@ROLE_SHORT_GK"), so saved messages follow the current language.
Definition role_utils.cpp:47
static const char * longName(PlayerRole role)
Localised full position name ("Goalkeeper", "Portiere").
Definition role_utils.cpp:41
A simple 2D float vector for pitch coordinates.
Definition types.h:84
PlayerRole
Represents a specific tactical role on the pitch.
Definition types.h:63