mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-18 16:33:24 +00:00
2adbca628b
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
23 lines
No EOL
536 B
C#
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;
|
|
}
|
|
}
|
|
} |