Verse Library verse

15 Adding Logic Based On Current Round

Calculates the next round based on player progress and saves it to session storage.

extracted-snippets/documentation/en-us/uefn/custom-round-logic-using-verse/15-adding-logic-based-on-current-round.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/custom-round-logic-using-verse
# Local doc:  epic-docs/documentation/en-us/uefn/custom-round-logic-using-verse.md
# Section:    Adding Logic Based on Current Round
RecordCurrentRound<public>(Players:[]player, TotalRounds:int):void=
var CurrentRoundInfo:round_info =
if:
Info := RoundInfo[GetSession()]
then:
Info
else:
LastCompletedRound := GetLastCompletedRound(Players, TotalRounds)
round_info:
CurrentRound := LastCompletedRound + 1
if:
set RoundInfo[GetSession()] = CurrentRoundInfo
else:
Print("Unable to record round info in session weak map.")

Comments

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