mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-13 00:54:37 +00:00
ad23f95319
only basic messages, wip.
40 lines
913 B
C#
40 lines
913 B
C#
using Supercell.GUT.Titan.Encoding;
|
|
using Supercell.GUT.Titan.Encoding.Streamed;
|
|
|
|
namespace Supercell.GUT.Titan.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();
|
|
}
|
|
}
|