PKHeX/PKHeX.Core/Saves/Substructures/Gen7/SaveBlock.cs
Kurt 2adbca628b Add raw value edits
Not done for Array types or Object types
muh reflection, such spooky

mark Offset as non-browsable so it doesn't show up in propertygrid if the block is being edited by a grid :)

I imagine a struct-type-sensitive array property grid edit could be done via Buffer.BlockCopy to a dest array, but there's so few Array blocks... so meh
2020-01-23 21:30:39 -08:00

23 lines
No EOL
536 B
C#

using System.ComponentModel;
namespace PKHeX.Core
{
/// <summary>
/// Base class for a savegame data reader.
/// </summary>
public abstract class SaveBlock
{
[Browsable(false)]
public int Offset { get; protected set; }
public readonly byte[] Data;
protected readonly SaveFile SAV;
protected SaveBlock(SaveFile sav) => Data = (SAV = sav).Data;
protected SaveBlock(SaveFile sav, byte[] data)
{
SAV = sav;
Data = data;
}
}
}