mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-10 07:44:37 +00:00
8c6a533918
todo: improve code and finish base structures
58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
using Supercell.GUT.Logic.Base;
|
|
using Supercell.GUT.Titan.Logic.DataStream;
|
|
|
|
namespace Supercell.GUT.Logic.Player;
|
|
|
|
public class LogicPlayerStats : LogicBase
|
|
{
|
|
public int Score { get; set; }
|
|
public int MatchCount { get; set; }
|
|
public int WinCount { get; set; }
|
|
public int KillCount { get; set; }
|
|
|
|
public LogicPlayerStats() : base(20486)
|
|
{
|
|
this.Score = 0;
|
|
this.MatchCount = 0;
|
|
this.WinCount = 0;
|
|
this.KillCount = 0;
|
|
}
|
|
|
|
public LogicPlayerStats(int logicDataVersion) : base(logicDataVersion)
|
|
{
|
|
this.Score = 0;
|
|
this.MatchCount = 0;
|
|
this.WinCount = 0;
|
|
this.KillCount = 0;
|
|
}
|
|
|
|
public override void Destruct()
|
|
{
|
|
base.Destruct();
|
|
|
|
this.Score = 0;
|
|
this.MatchCount = 0;
|
|
this.WinCount = 0;
|
|
this.KillCount = 0;
|
|
}
|
|
|
|
public override void Encode(ChecksumEncoder checksumEncoder)
|
|
{
|
|
base.Encode(checksumEncoder);
|
|
|
|
checksumEncoder.WriteInt(this.Score);
|
|
checksumEncoder.WriteInt(this.MatchCount);
|
|
checksumEncoder.WriteInt(this.WinCount);
|
|
checksumEncoder.WriteInt(this.KillCount);
|
|
}
|
|
|
|
public override void Decode(ByteStream byteStream)
|
|
{
|
|
base.Decode(byteStream);
|
|
|
|
this.Score = byteStream.ReadInt();
|
|
this.MatchCount = byteStream.ReadInt();
|
|
this.WinCount = byteStream.ReadInt();
|
|
this.KillCount = byteStream.ReadInt();
|
|
}
|
|
}
|