2020-07-31 20:53:42 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
public interface IRegionOrigin
|
|
|
|
|
{
|
2021-03-24 00:05:15 +00:00
|
|
|
|
/// <summary> Console hardware region. </summary>
|
2021-08-03 03:59:40 +00:00
|
|
|
|
/// <see cref="Region3DSIndex"/>
|
2021-08-03 02:43:57 +00:00
|
|
|
|
byte ConsoleRegion { get; set; }
|
2021-03-24 00:05:15 +00:00
|
|
|
|
/// <summary> Console's configured Country via System Settings. </summary>
|
2021-08-03 02:43:57 +00:00
|
|
|
|
byte Country { get; set; }
|
2021-03-24 00:05:15 +00:00
|
|
|
|
/// <summary> Console's configured Region within <see cref="Country"/> via System Settings. </summary>
|
2021-08-03 02:43:57 +00:00
|
|
|
|
byte Region { get; set; }
|
2020-07-31 20:53:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static partial class Extensions
|
|
|
|
|
{
|
|
|
|
|
public static void SetDefaultRegionOrigins(this IRegionOrigin o)
|
|
|
|
|
{
|
|
|
|
|
o.ConsoleRegion = 1; // North America
|
|
|
|
|
o.Region = 7; // California
|
|
|
|
|
o.Country = 49; // USA
|
|
|
|
|
}
|
2022-01-04 03:33:10 +00:00
|
|
|
|
|
|
|
|
|
public static void CopyRegionOrigin(this IRegionOrigin source, IRegionOrigin dest)
|
|
|
|
|
{
|
|
|
|
|
dest.ConsoleRegion = source.ConsoleRegion;
|
|
|
|
|
dest.Country = source.Country;
|
|
|
|
|
dest.Region = source.Region;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void ClearRegionOrigin(this IRegionOrigin o)
|
|
|
|
|
{
|
|
|
|
|
o.ConsoleRegion = o.Region = o.Country = 0;
|
|
|
|
|
}
|
2020-07-31 20:53:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|