2024-03-05 10:37:18 +00:00
|
|
|
|
using Supercell.GUT.Titan.Logic.DataStream;
|
2024-03-04 13:19:32 +00:00
|
|
|
|
|
2024-03-05 10:37:18 +00:00
|
|
|
|
namespace Supercell.GUT.Titan.Logic.Math;
|
2024-03-04 13:19:32 +00:00
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|