52 const std::vector<TeamID>& initial_team_ids = {},
53 std::optional<LeagueID> parent = std::nullopt,
62 uint8_t
getId()
const;
Represents a football league containing teams and a leaderboard.
Definition league.h:41
TieBreakRule getTieBreakRule() const
Ordering rule for teams level on points.
Definition league.h:130
TieBreakRule tie_break
Definition league.h:136
void removeTeamID(TeamID team_id)
Removes a team from the league.
Definition league.cpp:46
std::optional< LeagueID > getParentLeagueID() const
Gets the parent league ID, if any.
Definition league.cpp:84
void addTeamID(TeamID team_id)
Adds a team to the league.
Definition league.cpp:37
void addPoints(TeamID team_id, uint16_t points)
Adds points to a specific team.
Definition league.cpp:61
const std::vector< TeamID > & getTeamIDs() const
Gets the IDs of the teams in the league.
Definition league.cpp:35
uint8_t getId() const
Gets the league ID.
Definition league.cpp:31
uint16_t getPoints(TeamID team_id) const
Gets the points of a specific team.
Definition league.cpp:55
std::map< TeamID, uint16_t > leaderboard
Definition league.h:138
std::vector< TeamID > team_ids
Definition league.h:137
void resetPoints()
Resets the points of all teams in the league to zero.
Definition league.cpp:71
std::string name
Definition league.h:134
const std::map< TeamID, uint16_t > & getLeaderboard() const
Gets the league leaderboard.
Definition league.cpp:79
const std::optional< LeagueID > parent_league_id
Definition league.h:135
std::string getName() const
Gets the name of the league.
Definition league.cpp:33
void setPoints(TeamID team_id, uint16_t points)
Sets the points of a specific team.
Definition league.cpp:66
const LeagueID id
Definition league.h:133
TieBreakRule
How teams level on points are ordered (varies by country).
Definition league.h:24
uint8_t LeagueID
Type alias for League identifiers.
Definition types.h:15
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18