PKHeX/PKHeX.Core/Saves/Substructures/Gen7/SaveBlock.cs

29 lines
587 B
C#
Raw Normal View History

using System.ComponentModel;
2022-04-10 01:12:57 +00:00
namespace PKHeX.Core;
/// <summary>
/// Base class for a savegame data reader.
/// </summary>
public abstract class SaveBlock<T> : IDataIndirect where T : SaveFile
{
protected readonly T SAV;
[Browsable(false)] public byte[] Data { get; }
[Browsable(false)] public int Offset { get; protected init; }
2022-04-10 01:12:57 +00:00
protected SaveBlock(T sav) : this(sav, sav.Data) { }
2022-04-10 01:12:57 +00:00
protected SaveBlock(T sav, byte[] data)
{
2022-04-10 01:12:57 +00:00
SAV = sav;
Data = data;
}
}
public interface IDataIndirect
2022-04-10 01:12:57 +00:00
{
int Offset { get; }
byte[] Data { get; }
2022-04-10 01:12:57 +00:00
}