Class ArenaParticipant
This class combines the information from ArenaScore and ArenaInformation, and brings together information about the arena participant, including additional information.
public class ArenaParticipant : IBencodable, IState
- Inheritance
-
ArenaParticipant
- Implements
-
IBencodable
- Inherited Members
Constructors
ArenaParticipant(IValue)
public ArenaParticipant(IValue bencoded)
Parameters
bencoded
IValue
ArenaParticipant(Address)
public ArenaParticipant(Address avatarAddr)
Parameters
avatarAddr
Address
Fields
AvatarAddr
public readonly Address AvatarAddr
Field Value
- Address
Cp
public int Cp
Field Value
DefaultScore
public const int DefaultScore = 1000
Field Value
LastBattleBlockIndex
public long LastBattleBlockIndex
Field Value
Level
public int Level
Field Value
Lose
public int Lose
Field Value
MaxTicketCount
public const int MaxTicketCount = 8
Field Value
Name
If you need to know NameWithHash, check PostConstructor() method of the AvatarState class and you can find the relevant information there. It provides a formatted string that includes the avatar's name and a shortened version of their address.
public string Name
Field Value
Examples
$"{name} <size=80%><color=#A68F7E>#{address.ToHex().Substring(0, 4)}</color></size>";
PortraitId
public int PortraitId
Field Value
PurchasedTicketCount
public int PurchasedTicketCount
Field Value
Score
public int Score
Field Value
Ticket
public int Ticket
Field Value
TicketResetCount
public int TicketResetCount
Field Value
Win
public int Win
Field Value
Properties
Bencoded
An Bencodex.Types.IValue representation of this object that can be decoded back to instantiate an equal object. The decoded object must be equal to the original in the sense that Equals(T) should be true.
public IValue Bencoded { get; }
Property Value
- IValue
Remarks
Note that the only requirement is that the produced Bencodex.Types.IValue can be decoded back to an equal object. This representation may not be canonical in the sense that additional junk data may be present in an Bencodex.Types.IValue that one may wish to decode and this may be discarded while decoding.
A specific implemnetation may decide to only allow the canonical representation to be decoded.
Methods
AddScore(int)
public void AddScore(int score)
Parameters
score
int
BuyTicket(long)
public void BuyTicket(long maxCount)
Parameters
maxCount
long
ResetTicket(int)
public void ResetTicket(int resetCount)
Parameters
resetCount
int
Serialize()
public IValue Serialize()
Returns
- IValue
UpdateRecord(int, int)
public void UpdateRecord(int win, int lose)
Parameters
UseTicket(int)
public void UseTicket(int ticketCount)
Parameters
ticketCount
int