mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-26 22:10:21 +00:00
23 lines
576 B
C#
23 lines
576 B
C#
using System;
|
|
using System.ComponentModel;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Base class for a savegame data reader.
|
|
/// </summary>
|
|
public abstract class SaveBlock<T>(T sav, Memory<byte> raw) : IDataIndirect where T : SaveFile
|
|
{
|
|
protected readonly T SAV = sav;
|
|
|
|
[Browsable(false)] protected Memory<byte> Raw => raw;
|
|
[Browsable(false)] public Span<byte> Data => raw.Span;
|
|
|
|
public bool Equals(ReadOnlyMemory<byte> other) => other.Equals(raw);
|
|
}
|
|
|
|
public interface IDataIndirect
|
|
{
|
|
Span<byte> Data { get; }
|
|
bool Equals(ReadOnlyMemory<byte> other);
|
|
}
|