using System;
namespace PKHeX.Core;
///
/// Stores an IV template.
///
///
///
///
///
///
///
/// Differentiate between different IV templates, or lack thereof (0).
public readonly record struct IndividualValueSet(sbyte HP, sbyte ATK, sbyte DEF, sbyte SPE, sbyte SPA, sbyte SPD, byte Type = 1)
{
// 8 BYTES MAX STRUCTURE
// Default struct will be zero type.
public bool IsSpecified => Type != 0;
public sbyte this[int index] => index switch
{
0 => HP,
1 => ATK,
2 => DEF,
3 => SPE,
4 => SPA,
5 => SPD,
_ => throw new ArgumentOutOfRangeException(nameof(index), index, null),
};
public void CopyToSpeedLast(Span span)
{
span[5] = SPE;
span[4] = SPD;
span[3] = SPA;
span[2] = DEF;
span[1] = ATK;
span[0] = HP;
}
}