Class PointsService
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
configurationPointsConfigurationpointsSqlIPointsStoreplayerServiceIPlayerServicetranslationsTranslationInjection<PointsTranslations>loggerILogger<PointsService>uiPointsUImoduleWarfareModule
Properties
CreditsColor
public Color32 CreditsColor { get; }
Property Value
- Color32
DefaultCredits
public double DefaultCredits { get; }
Property Value
ExperienceColor
public Color32 ExperienceColor { get; }
Property Value
- Color32
GlobalMultiplier
public double GlobalMultiplier { get; }
Property Value
Ranks
Ordered list of all configured ranks.
public IReadOnlyList<WarfareRank> Ranks { get; }
Property Value
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
playerIdCSteamIDfactionIduintseasoninteventResolvedEventInfotokenCancellationToken
Returns
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
playerIdCSteamIDfactionIduinteventResolvedEventInfotokenCancellationToken
Returns
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
playerWarfarePlayereventResolvedEventInfotokenCancellationToken
Returns
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
setLanguageSetxpdouble?creditsdouble?reputationdouble?
Returns
GetEvent(string)
Get an event from settings.
public EventInfo GetEvent(string eventId)
Parameters
eventIdstring
Returns
GetPurchaseEvent(WarfarePlayer, double)
Get an event meant for credit purchases.
public ResolvedEventInfo GetPurchaseEvent(WarfarePlayer player, double credits)
Parameters
playerWarfarePlayercreditsdoubleThe number of credits to remove. This should not be negative.
Returns
GetRankByName(string)
Find rank info from its name, then its abbreviation.
public WarfareRank? GetRankByName(string name)
Parameters
namestring
Returns
GetRankFromExperience(double)
Find rank info from an experience value.
public WarfareRank GetRankFromExperience(double experience)
Parameters
experiencedouble
Returns
GetRankFromLevel(int)
Find rank info from a one-based level.
public WarfareRank? GetRankFromLevel(int level)
Parameters
levelint
Returns
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
ePlayerTeamChangedserviceProviderIServiceProvider