2017-07-06 23:03:41 +00:00
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generation 2 Time of Encounter enum
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal enum EncounterTime
|
2017-07-06 23:03:41 +00:00
|
|
|
|
{
|
|
|
|
|
Any = -1,
|
|
|
|
|
MorningDay = -2,
|
|
|
|
|
Morning = 1,
|
|
|
|
|
Day = 2,
|
|
|
|
|
Night = 3
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-24 06:12:58 +00:00
|
|
|
|
internal static class EncounterTimeExtension
|
2017-07-06 23:03:41 +00:00
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
internal static bool Contains(this EncounterTime t1, int t2) => t1.Contains((EncounterTime)t2);
|
2017-07-06 23:03:41 +00:00
|
|
|
|
private static bool Contains(this EncounterTime t1, EncounterTime t2)
|
|
|
|
|
{
|
|
|
|
|
if (t1 == t2 || t1 == EncounterTime.Any || t2 == EncounterTime.Any)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (t1 == EncounterTime.MorningDay)
|
2017-07-07 00:01:29 +00:00
|
|
|
|
return t2 == EncounterTime.Morning || t2 == EncounterTime.Day;
|
2017-07-06 23:03:41 +00:00
|
|
|
|
|
|
|
|
|
if (t2 == EncounterTime.MorningDay)
|
2017-07-07 00:01:29 +00:00
|
|
|
|
return t1 == EncounterTime.Morning || t1 == EncounterTime.Day;
|
2017-07-06 23:03:41 +00:00
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|