Table of Contents

Class WarfareRank

Namespace
Uncreated.Warfare.Stats
Assembly
Uncreated.Warfare.dll
[RpcSerializable(26, false)]
public class WarfareRank : ITranslationArgument, IRpcSerializable
Inheritance
WarfareRank
Implements
IRpcSerializable
Inherited Members
Extension Methods

Constructors

WarfareRank()

public WarfareRank()

Fields

FormatAbbreviation

public static readonly SpecialFormat FormatAbbreviation

Field Value

SpecialFormat

FormatLPrefixedNumeric

public static readonly SpecialFormat FormatLPrefixedNumeric

Field Value

SpecialFormat

FormatName

public static readonly SpecialFormat FormatName

Field Value

SpecialFormat

FormatNumeric

public static readonly SpecialFormat FormatNumeric

Field Value

SpecialFormat

Properties

Abbreviation

An abbreviation for the name of the rank.

public string Abbreviation { get; }

Property Value

string

CumulativeExperience

The total experience to get to this rank.

public double CumulativeExperience { get; }

Property Value

double

Experience

The experience to get from the this rank to the next rank.

public double Experience { get; }

Property Value

double

Level

The one-based level/index of this rank.

public int Level { get; }

Property Value

int

Name

The name of the rank.

public string Name { get; }

Property Value

string

Next

A reference to the next rank.

public WarfareRank? Next { get; set; }

Property Value

WarfareRank

Previous

A reference to the previous rank.

public WarfareRank? Previous { get; set; }

Property Value

WarfareRank

RankIndex

The zero-based index of this rank.

public int RankIndex { get; }

Property Value

int

Methods

GetProgress(double)

Calculates the progress that a player with a certain amount of total xp would be to getting to the next rank.

public double GetProgress(double xp)

Parameters

xp double

Returns

double

An unclamped percentage on the [0, 1] scale.

GetSize(IRpcSerializer)

The exact size of this object in it's current state.

public int GetSize(IRpcSerializer serializer)

Parameters

serializer IRpcSerializer

Returns

int

Remarks

This property should be marked readonly on value types, otherwise the behaivor is undefined.

Read(Span<byte>, IRpcSerializer)

Read the data from readFrom to this type.

public int Read(Span<byte> readFrom, IRpcSerializer serializer)

Parameters

readFrom Span<byte>
serializer IRpcSerializer

Returns

int

-1 if there's not enough data, otherwise the amount of bytes read.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Translate(ITranslationValueFormatter, in ValueFormatParameters)

Allows objects to define how they're translated in their own definition instead of creating a value converter.

public string Translate(ITranslationValueFormatter formatter, in ValueFormatParameters parameters)

Parameters

formatter ITranslationValueFormatter
parameters ValueFormatParameters

Returns

string

Write(Span<byte>, IRpcSerializer)

Write the data in this type to writeTo.

public int Write(Span<byte> writeTo, IRpcSerializer serializer)

Parameters

writeTo Span<byte>
serializer IRpcSerializer

Returns

int

The number of bytes written. Must be consistant with DanielWillett.ModularRpcs.Serialization.IRpcSerializable.GetSize(DanielWillett.ModularRpcs.Serialization.IRpcSerializer).

Remarks

This method should be marked readonly on value types, otherwise the behaivor is undefined.