mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-25 03:43:16 +00:00
e9a3b4acf1
Gen5 does not follow the same convention, 0 = non, 1 = rnd, 2 = always; not gonna bother updating for just that one bool? occupies 2 bytes; enum:byte is 1 byte. should probably move validity checking logic into the IEncounterable objects instead...
42 lines
1 KiB
C#
42 lines
1 KiB
C#
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Specification for <see cref="PKM.IsShiny"/>, used for creating and validating.
|
|
/// </summary>
|
|
public enum Shiny : byte
|
|
{
|
|
/// <summary>
|
|
/// PID is fixed to a specified value.
|
|
/// </summary>
|
|
FixedValue = 0,
|
|
|
|
/// <summary>
|
|
/// PID is purely random; can be shiny or not shiny.
|
|
/// </summary>
|
|
Random = 1,
|
|
|
|
/// <summary>
|
|
/// PID is randomly created and forced to be shiny.
|
|
/// </summary>
|
|
Always = 2,
|
|
|
|
/// <summary>
|
|
/// PID is randomly created and forced to be not shiny.
|
|
/// </summary>
|
|
Never = 3,
|
|
}
|
|
|
|
public static partial class Extensions
|
|
{
|
|
public static bool IsValid(this Shiny s, PKM pkm)
|
|
{
|
|
switch (s)
|
|
{
|
|
case Shiny.Always: return pkm.IsShiny;
|
|
case Shiny.Never: return !pkm.IsShiny;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|