mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-19 00:43:14 +00:00
21cdf4f642
wonder if it's possible to provide a more lightweight core by pulling out legality stuff to a separate project?
32 lines
No EOL
907 B
C#
32 lines
No EOL
907 B
C#
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Generation 2 Time of Encounter enum
|
|
/// </summary>
|
|
internal enum EncounterTime
|
|
{
|
|
Any = -1,
|
|
MorningDay = -2,
|
|
Morning = 1,
|
|
Day = 2,
|
|
Night = 3
|
|
}
|
|
|
|
internal static class EncounterTimeExtension
|
|
{
|
|
internal static bool Contains(this EncounterTime t1, int t2) => t1.Contains((EncounterTime)t2);
|
|
private static bool Contains(this EncounterTime t1, EncounterTime t2)
|
|
{
|
|
if (t1 == t2 || t1 == EncounterTime.Any || t2 == EncounterTime.Any)
|
|
return true;
|
|
|
|
if (t1 == EncounterTime.MorningDay)
|
|
return t2 == EncounterTime.Morning || t2 == EncounterTime.Day;
|
|
|
|
if (t2 == EncounterTime.MorningDay)
|
|
return t1 == EncounterTime.Morning || t1 == EncounterTime.Day;
|
|
|
|
return false;
|
|
}
|
|
}
|
|
} |