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