2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// GameCube save file interface for memory cards.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IGCSaveFile
|
2019-02-19 05:59:57 +00:00
|
|
|
|
{
|
2019-07-14 22:06:45 +00:00
|
|
|
|
/// <summary>
|
2022-06-18 18:04:24 +00:00
|
|
|
|
/// GameCube Memory Card the save file was read from.
|
2019-07-14 22:06:45 +00:00
|
|
|
|
/// </summary>
|
2022-06-18 18:04:24 +00:00
|
|
|
|
SAV3GCMemoryCard? MemoryCard { get; }
|
|
|
|
|
}
|
2019-02-19 05:59:57 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public static class GCSaveExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets an export filter for a GameCube file.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static string GCFilter(this IGCSaveFile gc)
|
2019-02-19 05:59:57 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
const string regular = "GameCube Save File|*.gci|All Files|*.*";
|
|
|
|
|
const string memcard = "Memory Card Raw File|*.raw|Memory Card Binary File|*.bin|";
|
|
|
|
|
return gc.MemoryCard is not null ? memcard + regular : regular;
|
2019-02-19 05:59:57 +00:00
|
|
|
|
}
|
2022-06-18 18:04:24 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the export extension for a GameCube file.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static string GCExtension(this IGCSaveFile gc) => gc.MemoryCard is not null ? ".raw" : ".gci";
|
|
|
|
|
}
|