AxibugEmuOnline/AxibugEmuOnline.Client/Assets/VirtualNes.Core/State/BLOCKHDR.cs

28 lines
747 B
C#
Raw Normal View History

2024-08-29 17:20:01 +08:00
namespace VirtualNes.Core
{
public struct BLOCKHDR : IStateBufferObject
{
public readonly bool Valid => !string.IsNullOrEmpty(ID);
2024-08-29 17:20:01 +08:00
public string ID;
public ushort Reserved;
public ushort BlockVersion;
public uint BlockSize;
public readonly void SaveState(StateBuffer buffer)
{
if (Valid)
{
buffer.Write(ID);
buffer.Write(Reserved);
buffer.Write(BlockVersion);
buffer.Write(BlockSize);
}
2024-08-29 17:20:01 +08:00
}
public readonly uint GetSize()
{
return (uint)(ID.Length + sizeof(ushort) + sizeof(ushort) + sizeof(uint));
}
}
}