MapRotation

Summary

MapRotation global table. Manages the server's map rotation, including adding, removing, and getting map entries.

Functions

MethodReturns
AddMap(level: string, mode: string)void
Clear(level: string, mode: string)void
GetNextMap()MapRotationEntry
RemoveNextMap()void
GetCurrentEntryIndex()integer
GetList()MapRotationEntry[]

Functions

AddMap

MapRotation.AddMap(level: string, mode: string): void

Adds a map entry to the end of the rotation. Raises an error if either level or mode is an empty string.

Parameters

NameTypeDescription
levelstringThe level path to add.
modestringThe gamemode id to add.

Clear

MapRotation.Clear(level: string, mode: string): void

Clears the entire rotation and resets it with a single required starting entry. Raises an error if either level or mode is an empty string.

Parameters

NameTypeDescription
levelstringThe level path for the first entry after clearing.
modestringThe gamemode id for the first entry after clearing.

GetNextMap

MapRotation.GetNextMap(): MapRotationEntry

Returns the next map entry in the rotation without removing it.

Returns

TypeDescription
MapRotationEntryentry A table containing level and mode fields.

RemoveNextMap

MapRotation.RemoveNextMap(): void

Removes the next map entry from the rotation.

GetCurrentEntryIndex

MapRotation.GetCurrentEntryIndex(): integer

Returns the current index within the map rotation list.

Returns

TypeDescription
integerindex The index of the current rotation entry.

GetList

MapRotation.GetList(): MapRotationEntry

Returns the full list of map rotation entries.

Returns

TypeDescription
MapRotationEntry[]entries An array of tables, each containing level and mode fields.