Supercell.GUT/Supercell.GUT.Titan/Logic/Math/LogicLong.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

39 lines
882 B
C#

using Supercell.GUT.Titan.Logic.DataStream;
namespace Supercell.GUT.Titan.Logic.Math;
public class LogicLong
{
public int HigherInt { get; set; }
public int LowerInt { get; set; }
public LogicLong(long longValue)
{
this.HigherInt = (int)(longValue >> 32);
this.LowerInt = (int)longValue;
}
public LogicLong()
{
this.HigherInt = 0;
this.LowerInt = 0;
}
public LogicLong(int higherInt, int lowerInt)
{
this.HigherInt = higherInt;
this.LowerInt = lowerInt;
}
public void Encode(ChecksumEncoder checksumEncoder)
{
checksumEncoder.WriteInt(this.HigherInt);
checksumEncoder.WriteInt(this.LowerInt);
}
public void Decode(ByteStream byteStream)
{
this.HigherInt = byteStream.ReadInt();
this.LowerInt = byteStream.ReadInt();
}
}