mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 16:48:01 +00:00
4baf745af8
static local functions switch expressions using usings :) nullable next?
41 lines
998 B
C#
41 lines
998 B
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)
|
|
{
|
|
return s switch
|
|
{
|
|
Shiny.Always => pkm.IsShiny,
|
|
Shiny.Never => !pkm.IsShiny,
|
|
_ => true
|
|
};
|
|
}
|
|
}
|
|
}
|