Update documentation for techrecord flag methods

Allow an ienumerable of moves rather than a readonly list
This commit is contained in:
Kurt 2019-11-16 08:18:57 -08:00
parent d1e9bc3877
commit d7657f948d

View File

@ -567,8 +567,8 @@ public static void SetRecordFlags(this PKM pk, bool value, int max = 100)
/// Sets the Technical Record flags for the <see cref="pk"/> based on the current moves.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
/// <param name="moves">Moves to set flags for (if applicable)</param>
public static void SetRecordFlags(this PKM pk, IReadOnlyList<int> moves)
/// <param name="moves">Moves to set flags for. If a move is not a Technical Record, it is skipped.</param>
public static void SetRecordFlags(this PKM pk, IEnumerable<int> moves)
{
if (!(pk is PK8 pk8))
return;
@ -581,17 +581,17 @@ public static void SetRecordFlags(this PKM pk, IReadOnlyList<int> moves)
}
/// <summary>
/// Sets all the Technical Record flags for the <see cref="pk"/>.
/// Sets all the Technical Record flags for the <see cref="pk"/> if they are permitted to be learned in-game.
/// </summary>
/// <param name="pk">Pokémon to modify.</param>
public static void SetRecordFlags(this PKM pk)
{
if (!(pk is PK8 pk8))
return;
var pi = pk8.PersonalInfo.TMHM;
for (int i = 100; i < pi.Length; i++)
var permit = pk8.PersonalInfo.TMHM;
for (int i = 100; i < permit.Length; i++)
{
if (pi[i])
if (permit[i])
pk8.SetMoveRecordFlag(i - 100, true);
}
}