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
|
|
|
|
|
{
|
|
|
|
|
bool IsMemoryCardSave { get; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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|";
|
|
|
|
|
return gc.IsMemoryCardSave ? memcard + regular : regular;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-14 22:06:45 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the export extension for a GameCube file.
|
|
|
|
|
/// </summary>
|
2019-02-19 05:59:57 +00:00
|
|
|
|
public static string GCExtension(this IGCSaveFile gc) => gc.IsMemoryCardSave ? ".raw" : ".gci";
|
|
|
|
|
}
|
|
|
|
|
}
|