Verse Library verse

Race Order

verse-source/SampleVerse/SpeedwayPersistenceTemplate/RaceManagement/race_order.verse

# This file defines the player_circuit_info, a persistable class that tracks a player's
# finish order and last completed round during the race.It also defines the round_info class to track player
# starting positions and the current round number. It uses both of these to set up the raceline
# starting order of players by ordering players based on who came before in the previous round.

using { /Fortnite.com/Devices }
using { /Fortnite.com/FortPlayerUtilities }
using { /Verse.org/Random }
using { /Verse.org/Simulation }

# A persistable map that maps each player to the number of and in
# what order they finished the previous round.
#var CircuitInfo<public>:weak_map(player, player_circuit_info) = map{}
#race_order := class():
#    var CircuitInfo<public>:[player]player_circuit_info = map{}

# Maps the current session to its associated round info.
var RoundInfo:weak_map(session, round_info) = map{}

# Maps each player to their start position during the race, and tracks the
# current number.
round_info := class:
    var PlayerStartPositions:[agent]start_position = map{}
    CurrentRound:int = -1

# Tracks the number of and in what order a player finished the previous round.
player_circuit_info<public> := class<final><persistable>:
    Version:int = 0
    LastRoundFinishOrder:int = -1
    LastCompletedRound<public>:int = -1

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

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