more uniform names for encode/decode methods, beginnings of cached/dirty data concept for payloads, to prevent regeneration when they are unmodified. This may change or go away entirely as more work is done

This commit is contained in:
meli 2020-04-21 17:22:42 -07:00
parent f2cee5f5bc
commit 7bab3a45f5
11 changed files with 101 additions and 73 deletions

View file

@ -25,7 +25,12 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
private uint group;
private uint key;
public override byte[] Encode()
public override string ToString()
{
return $"{Type} - Group: {group}, Key: {key}";
}
protected override byte[] EncodeImpl()
{
var keyBytes = MakeInteger(this.key);
@ -42,12 +47,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
return bytes.ToArray();
}
public override string ToString()
{
return $"{Type} - Group: {group}, Key: {key}";
}
protected override void ProcessChunkImpl(BinaryReader reader, long endOfStream)
protected override void DecodeImpl(BinaryReader reader, long endOfStream)
{
// this seems to always be a bare byte, and not following normal integer encoding
// the values in the table are all <70 so this is presumably ok