Table of Contents

Class LevelManager

Namespace
S1API.Leveling
Assembly
S1API.dll

Exposes the player progression system, including ranks, tiers, XP, unlockables, and related events.

public static class LevelManager
Inheritance
LevelManager
Inherited Members

Properties

CurrentRank

The player's current rank and tier combined.

public static FullRank CurrentRank { get; }

Property Value

FullRank

Exists

Returns true when the underlying levelling manager has been instantiated.

public static bool Exists { get; }

Property Value

bool

Rank

The player's current rank.

public static Rank Rank { get; }

Property Value

Rank

Tier

The player's current tier within their rank.

public static int Tier { get; }

Property Value

int

TotalXP

Total XP accumulated across all ranks.

public static int TotalXP { get; }

Property Value

int

XP

XP progress within the current tier.

public static int XP { get; }

Property Value

int

XPToNextTier

XP required to reach the next tier threshold.

public static float XPToNextTier { get; }

Property Value

float

Methods

AddUnlockable(Unlockable)

Registers an unlockable item for the specified rank.

public static void AddUnlockable(Unlockable unlockable)

Parameters

unlockable Unlockable

AddXP(int)

Adds XP to the player. Only works when invoked from the host/server.

public static void AddXP(int amount)

Parameters

amount int

How much XP to award.

GetFullRankForXP(int)

Converts a target XP value to the associated rank and tier.

public static FullRank GetFullRankForXP(int totalXp)

Parameters

totalXp int

Returns

FullRank

GetOrderLimitMultiplier(FullRank)

Returns the order limit multiplier used by customer systems for the specified rank.

public static float GetOrderLimitMultiplier(FullRank rank)

Parameters

rank FullRank

Returns

float

GetTotalXPForRank(FullRank)

Gets the total XP required to reach a specific rank/tier combination.

public static int GetTotalXPForRank(FullRank rank)

Parameters

rank FullRank

Returns

int

GetUnlockables(FullRank)

Enumerates unlockables for the provided rank.

public static IEnumerable<Unlockable> GetUnlockables(FullRank rank)

Parameters

rank FullRank

Returns

IEnumerable<Unlockable>

GetXPForTier(Rank)

Gets the XP required to complete a tier for the specified rank.

public static int GetXPForTier(Rank rank)

Parameters

rank Rank

Returns

int

Events

OnRankUp

Raised when the player's rank or tier actually increases (tier increases within a rank, or rank increases when tier exceeds 5). This only fires when the rank/tier value changes, not on every XP update. Provides the previous and new rank values.

public static event Action<FullRank, FullRank>? OnRankUp

Event Type

Action<FullRank, FullRank>

OnXPChanged

Raised whenever XP or rank/tier data is updated, even if the rank/tier values haven't changed. This fires on every XP change, including when only XP increases without a rank/tier change. Provides the previous and new rank values (which may be the same).

public static event Action<FullRank, FullRank>? OnXPChanged

Event Type

Action<FullRank, FullRank>