namespace PKHeX.Core
{
///
/// Specification for , used for creating and validating.
///
public enum Shiny : byte
{
///
/// PID is fixed to a specified value.
///
FixedValue = 0,
///
/// PID is purely random; can be shiny or not shiny.
///
Random = 1,
///
/// PID is randomly created and forced to be shiny.
///
Always = 2,
///
/// PID is randomly created and forced to be not shiny.
///
Never = 3,
///
/// PID is randomly created and forced to be shiny as Stars.
///
AlwaysStar = 5,
///
/// PID is randomly created and forced to be shiny as Squares.
///
AlwaysSquare = 6,
}
public static partial class Extensions
{
public static bool IsValid(this Shiny s, PKM pkm) => s switch
{
Shiny.Always => pkm.IsShiny,
Shiny.Never => !pkm.IsShiny,
Shiny.AlwaysSquare => pkm.ShinyXor == 0,
Shiny.AlwaysStar => pkm.ShinyXor == 1,
_ => true
};
}
}