2022-08-21 08:39:16 +00:00
|
|
|
namespace PKHeX.Core;
|
2022-06-18 18:04:24 +00:00
|
|
|
|
2022-08-21 08:39:16 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Exposes details about the 3DS Console geolocation settings the trainer has set.
|
|
|
|
/// </summary>
|
2022-06-18 18:04:24 +00:00
|
|
|
public interface IRegionOrigin
|
|
|
|
{
|
|
|
|
/// <summary> Console hardware region. </summary>
|
|
|
|
/// <see cref="Region3DSIndex"/>
|
|
|
|
byte ConsoleRegion { get; set; }
|
|
|
|
/// <summary> Console's configured Country via System Settings. </summary>
|
|
|
|
byte Country { get; set; }
|
|
|
|
/// <summary> Console's configured Region within <see cref="Country"/> via System Settings. </summary>
|
|
|
|
byte Region { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public static partial class Extensions
|
2020-07-31 20:53:42 +00:00
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
public static void SetDefaultRegionOrigins(this IRegionOrigin o)
|
2020-07-31 20:53:42 +00:00
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
o.ConsoleRegion = 1; // North America
|
|
|
|
o.Region = 7; // California
|
|
|
|
o.Country = 49; // USA
|
2020-07-31 20:53:42 +00:00
|
|
|
}
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
public static void CopyRegionOrigin(this IRegionOrigin source, IRegionOrigin dest)
|
2020-07-31 20:53:42 +00:00
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
dest.ConsoleRegion = source.ConsoleRegion;
|
|
|
|
dest.Country = source.Country;
|
|
|
|
dest.Region = source.Region;
|
|
|
|
}
|
2022-01-04 03:33:10 +00:00
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
public static void ClearRegionOrigin(this IRegionOrigin o)
|
|
|
|
{
|
|
|
|
o.ConsoleRegion = o.Region = o.Country = 0;
|
2020-07-31 20:53:42 +00:00
|
|
|
}
|
|
|
|
}
|