Supercell.GUT/Supercell.GUT.Titan/Logic/Message/PiranhaMessage.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

40 lines
781 B
C#

using Supercell.GUT.Titan.Logic.DataStream;
namespace Supercell.GUT.Titan.Logic.Message;
public abstract class PiranhaMessage
{
public ByteStream ByteStream { get; }
public int MessageVersion { get; set; }
public PiranhaMessage(int messageVersion)
{
this.ByteStream = new ByteStream();
this.MessageVersion = messageVersion;
}
public virtual void Encode()
{
;
}
public virtual void Decode()
{
;
}
public abstract int GetServiceNodeType();
public abstract int GetMessageType();
public int GetEncodingLength()
{
return this.ByteStream.Length;
}
public virtual void Destruct()
{
this.ByteStream.Destruct();
this.MessageVersion = 0;
}
}