Table of Contents

Class PointsService

Namespace
Uncreated.Warfare.Stats
Assembly
Uncreated.Warfare.dll
public class PointsService : IEventListener<PlayerTeamChanged>
Inheritance
PointsService
Implements
Inherited Members

Constructors

PointsService(PointsConfiguration, IPointsStore, IPlayerService, TranslationInjection<PointsTranslations>, ILogger<PointsService>, PointsUI, WarfareModule)

public PointsService(PointsConfiguration configuration, IPointsStore pointsSql, IPlayerService playerService, TranslationInjection<PointsTranslations> translations, ILogger<PointsService> logger, PointsUI ui, WarfareModule module)

Parameters

configuration PointsConfiguration
pointsSql IPointsStore
playerService IPlayerService
translations TranslationInjection<PointsTranslations>
logger ILogger<PointsService>
ui PointsUI
module WarfareModule

Properties

CreditsColor

public Color32 CreditsColor { get; }

Property Value

Color32

DefaultCredits

public double DefaultCredits { get; }

Property Value

double

ExperienceColor

public Color32 ExperienceColor { get; }

Property Value

Color32

GlobalMultiplier

public double GlobalMultiplier { get; }

Property Value

double

Ranks

Ordered list of all configured ranks.

public IReadOnlyList<WarfareRank> Ranks { get; }

Property Value

IReadOnlyList<WarfareRank>

Methods

ApplyEvent(CSteamID, uint, int, ResolvedEventInfo, CancellationToken)

Apply an event and trigger updates for the necessary UI.

public Task ApplyEvent(CSteamID playerId, uint factionId, int season, ResolvedEventInfo @event, CancellationToken token = default)

Parameters

playerId CSteamID
factionId uint
season int
event ResolvedEventInfo
token CancellationToken

Returns

Task

ApplyEvent(CSteamID, uint, ResolvedEventInfo, CancellationToken)

Apply an event and trigger updates for the necessary UI for the current season.

public Task ApplyEvent(CSteamID playerId, uint factionId, ResolvedEventInfo @event, CancellationToken token = default)

Parameters

playerId CSteamID
factionId uint
event ResolvedEventInfo
token CancellationToken

Returns

Task

ApplyEvent(WarfarePlayer, ResolvedEventInfo, CancellationToken)

Apply an event and trigger updates for the necessary UI for the current season.

public Task ApplyEvent(WarfarePlayer player, ResolvedEventInfo @event, CancellationToken token = default)

Parameters

player WarfarePlayer
event ResolvedEventInfo
token CancellationToken

Returns

Task

GetAdminEvent(in LanguageSet, double?, double?, double?)

Get an event meant for admin commands. Adds raw point values.

public ResolvedEventInfo GetAdminEvent(in LanguageSet set, double? xp, double? credits, double? reputation)

Parameters

set LanguageSet
xp double?
credits double?
reputation double?

Returns

ResolvedEventInfo

GetEvent(string)

Get an event from settings.

public EventInfo GetEvent(string eventId)

Parameters

eventId string

Returns

EventInfo

GetPurchaseEvent(WarfarePlayer, double)

Get an event meant for credit purchases.

public ResolvedEventInfo GetPurchaseEvent(WarfarePlayer player, double credits)

Parameters

player WarfarePlayer
credits double

The number of credits to remove. This should not be negative.

Returns

ResolvedEventInfo

GetRankByName(string)

Find rank info from its name, then its abbreviation.

public WarfareRank? GetRankByName(string name)

Parameters

name string

Returns

WarfareRank

GetRankFromExperience(double)

Find rank info from an experience value.

public WarfareRank GetRankFromExperience(double experience)

Parameters

experience double

Returns

WarfareRank

GetRankFromLevel(int)

Find rank info from a one-based level.

public WarfareRank? GetRankFromLevel(int level)

Parameters

level int

Returns

WarfareRank

Exceptions

ArgumentOutOfRangeException

Thrown if a value less than or equal to 0 is inputted for level.

HandleEvent(PlayerTeamChanged, IServiceProvider)

public void HandleEvent(PlayerTeamChanged e, IServiceProvider serviceProvider)

Parameters

e PlayerTeamChanged
serviceProvider IServiceProvider