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

@ -29,7 +29,12 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
private ushort colorKey;
public override byte[] Encode()
public override string ToString()
{
return $"{Type} - UIColor: {colorKey}";
}
protected override byte[] EncodeImpl()
{
var colorBytes = MakeInteger(this.colorKey);
var chunkLen = colorBytes.Length + 1;
@ -45,12 +50,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
return bytes.ToArray();
}
public override string ToString()
{
return $"{Type} - UIColor: {colorKey}";
}
protected override void ProcessChunkImpl(BinaryReader reader, long endOfStream)
protected override void DecodeImpl(BinaryReader reader, long endOfStream)
{
this.colorKey = (ushort)GetInteger(reader);
}