mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-26 10:44:07 -05:00
Add more xmldoc Move files/functions to better spot Less allocation on hover glow fix honeytree dppt group/slot/shake rand call (ty real.96)
43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Hatch Location validity for <see cref="GameVersion.SWSH"/>.
|
|
/// </summary>
|
|
public static class EggHatchLocation8
|
|
{
|
|
/// <summary>
|
|
/// Returns true if the hatch location is valid for Sword and Shield.
|
|
/// </summary>
|
|
public static bool IsValidMet8SWSH(int location)
|
|
{
|
|
if (location % 2 != 0)
|
|
return false;
|
|
|
|
var index = location >> 1;
|
|
var arr = LocationPermitted8;
|
|
if ((uint)index >= arr.Length)
|
|
return false;
|
|
return arr[index] != 0;
|
|
}
|
|
|
|
// Odd indexes ignored.
|
|
private static ReadOnlySpan<byte> LocationPermitted8 =>
|
|
[
|
|
0, 0, 0, 1, 1, 0, 1, 1, 1, 1,
|
|
1, 1, 1, 0, 1, 1, 1, 1, 1, 0,
|
|
1, 0, 1, 1, 1, 0, 1, 1, 1, 1,
|
|
1, 0, 1, 1, 1, 1, 1, 0, 1, 1,
|
|
1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1,
|
|
];
|
|
}
|