This technical documentation covers the core calculation functions implemented for the Rugby Tournament Management System.
The Match Score Calculator processes match events to calculate and display scores for rugby matches.
rtms_calculate_match_score($match_id)Calculates match scores based on match events.
[
'home_team' => [...],
'away_team' => [...],
'status' => (string),
'has_events' => (bool)
]
rtms_get_match_score_display($match_id)Returns a formatted match score string.
Invalid match IDDisplays match score with attributes:
Invalid match ID provided
Computes rankings based on match results according to rugby scoring rules.
rtms_calculate_tournament_standings($tournament_id, $force_recalculate = false)Calculates standings for all teams in a tournament.
Invalid tournament IDInvalid tournament ID provided
Calculates comprehensive statistics for players.
rtms_calculate_player_statistics($player_id, $tournament_id = null)Calculates statistics for a player.
No player specifiedInvalid player ID provided
Creates chronological displays of match events.
rtms_generate_match_timeline($match_id)Generates timeline data for a match.
No match specifiedInvalid match ID provided