Class WarfareRank
[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
FormatLPrefixedNumeric
public static readonly SpecialFormat FormatLPrefixedNumeric
Field Value
FormatName
public static readonly SpecialFormat FormatName
Field Value
FormatNumeric
public static readonly SpecialFormat FormatNumeric
Field Value
Properties
Abbreviation
An abbreviation for the name of the rank.
public string Abbreviation { get; }
Property Value
CumulativeExperience
The total experience to get to this rank.
public double CumulativeExperience { get; }
Property Value
Experience
The experience to get from the this rank to the next rank.
public double Experience { get; }
Property Value
Level
The one-based level/index of this rank.
public int Level { get; }
Property Value
Name
The name of the rank.
public string Name { get; }
Property Value
Next
A reference to the next rank.
public WarfareRank? Next { get; set; }
Property Value
Previous
A reference to the previous rank.
public WarfareRank? Previous { get; set; }
Property Value
RankIndex
The zero-based index of this rank.
public int RankIndex { get; }
Property Value
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
xpdouble
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
serializerIRpcSerializer
Returns
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
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
formatterITranslationValueFormatterparametersValueFormatParameters
Returns
Write(Span<byte>, IRpcSerializer)
Write the data in this type to writeTo.
public int Write(Span<byte> writeTo, IRpcSerializer serializer)
Parameters
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.