Verse Library verse

11 Sorting And Displaying The Best Player

Provides comparison logic to rank players by points and podiums for sorting a real-time in-game leaderboard.

extracted-snippets/documentation/en-us/uefn/make-your-own-in-game-leaderboard-in-verse/11-sorting-and-displaying-the-best-player.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/make-your-own-in-game-leaderboard-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/make-your-own-in-game-leaderboard-in-verse.md
# Section:    Sorting and Displaying the Best Player
# Returns Left if Left has greater Points than Right.
MorePointsComparison<public>(Left:player_and_stats, Right:player_and_stats)<decides><transacts>:player_and_stats=
Left.StatsTable.Points > Right.StatsTable.Points
Left
# Returns Left if Left has less Points than Right.
LessPointsComparison<public>(Left:player_and_stats, Right:player_and_stats)<decides><transacts>:player_and_stats=
Left.StatsTable.Points < Right.StatsTable.Points
Left
# Returns Left if Left has a greater number of Podiums than Right.
MorePodiumsComparison<public>(Left:player_and_stats, Right:player_and_stats)<decides><transacts>:player_and_stats=
Left.StatsTable.Points > Right.StatsTable.Points
Left
# Returns Left if Left has a lesser number of Podiums than Right.
LessPodiumsComparison<public>(Left:player_and_stats, Right:player_and_stats)<decides><transacts>:player_and_stats=
Left.StatsTable.Points < Right.StatsTable.Points
Left

Comments

    Sign in to vote, comment, or suggest an edit. Sign in