Supercell.GUT/Supercell.GUT.Logic/Player/LogicPlayerStats.cs
BreadDEV 8c6a533918 [v0.0.2] you can enter menu now. but still early state
todo: improve code and finish base structures
2024-03-05 17:37:18 +07:00

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();
}
}