Rename internal PKMInfo class to match batch names

This commit is contained in:
Kurt 2021-04-20 01:50:47 -07:00
parent d9c22b1d74
commit 9dfa1077ee
2 changed files with 11 additions and 11 deletions

View file

@ -225,7 +225,7 @@ namespace PKHeX.Core
} }
/// <summary> /// <summary>
/// Tries to modify the <see cref="PKMInfo"/>. /// Tries to modify the <see cref="BatchInfo"/>.
/// </summary> /// </summary>
/// <param name="pk">Command Filter</param> /// <param name="pk">Command Filter</param>
/// <param name="filters">Filters which must be satisfied prior to any modifications being made.</param> /// <param name="filters">Filters which must be satisfied prior to any modifications being made.</param>
@ -236,7 +236,7 @@ namespace PKHeX.Core
if (!pk.ChecksumValid || pk.Species == 0) if (!pk.ChecksumValid || pk.Species == 0)
return ModifyResult.Invalid; return ModifyResult.Invalid;
var info = new PKMInfo(pk); var info = new BatchInfo(pk);
var pi = Props[Array.IndexOf(Types, pk.GetType())]; var pi = Props[Array.IndexOf(Types, pk.GetType())];
foreach (var cmd in filters) foreach (var cmd in filters)
{ {
@ -276,13 +276,13 @@ namespace PKHeX.Core
} }
/// <summary> /// <summary>
/// Sets the if the <see cref="PKMInfo"/> should be filtered due to the <see cref="StringInstruction"/> provided. /// Sets the if the <see cref="BatchInfo"/> should be filtered due to the <see cref="StringInstruction"/> provided.
/// </summary> /// </summary>
/// <param name="cmd">Command Filter</param> /// <param name="cmd">Command Filter</param>
/// <param name="info">Pokémon to check.</param> /// <param name="info">Pokémon to check.</param>
/// <param name="props">PropertyInfo cache (optional)</param> /// <param name="props">PropertyInfo cache (optional)</param>
/// <returns>True if filtered, else false.</returns> /// <returns>True if filtered, else false.</returns>
private static ModifyResult SetPKMProperty(StringInstruction cmd, PKMInfo info, IReadOnlyDictionary<string, PropertyInfo> props) private static ModifyResult SetPKMProperty(StringInstruction cmd, BatchInfo info, IReadOnlyDictionary<string, PropertyInfo> props)
{ {
var pk = info.Entity; var pk = info.Entity;
if (cmd.PropertyValue.StartsWith(CONST_BYTES)) if (cmd.PropertyValue.StartsWith(CONST_BYTES))
@ -308,13 +308,13 @@ namespace PKHeX.Core
} }
/// <summary> /// <summary>
/// Checks if the <see cref="PKMInfo"/> should be filtered due to the <see cref="StringInstruction"/> provided. /// Checks if the <see cref="BatchInfo"/> should be filtered due to the <see cref="StringInstruction"/> provided.
/// </summary> /// </summary>
/// <param name="cmd">Command Filter</param> /// <param name="cmd">Command Filter</param>
/// <param name="info">Pokémon to check.</param> /// <param name="info">Pokémon to check.</param>
/// <param name="props">PropertyInfo cache (optional)</param> /// <param name="props">PropertyInfo cache (optional)</param>
/// <returns>True if filter matches, else false.</returns> /// <returns>True if filter matches, else false.</returns>
private static bool IsFilterMatch(StringInstruction cmd, PKMInfo info, IReadOnlyDictionary<string, PropertyInfo> props) private static bool IsFilterMatch(StringInstruction cmd, BatchInfo info, IReadOnlyDictionary<string, PropertyInfo> props)
{ {
if (IsLegalFiltered(cmd, () => info.Legal)) if (IsLegalFiltered(cmd, () => info.Legal))
return true; return true;
@ -390,7 +390,7 @@ namespace PKHeX.Core
/// <param name="name">Property to modify.</param> /// <param name="name">Property to modify.</param>
/// <param name="info">Cached info storing Legal data.</param> /// <param name="info">Cached info storing Legal data.</param>
/// <param name="propValue">Suggestion string which starts with <see cref="CONST_SUGGEST"/></param> /// <param name="propValue">Suggestion string which starts with <see cref="CONST_SUGGEST"/></param>
private static ModifyResult SetSuggestedPKMProperty(string name, PKMInfo info, string propValue) private static ModifyResult SetSuggestedPKMProperty(string name, BatchInfo info, string propValue)
{ {
static bool IsAll(string p) => p.EndsWith("All", true, CultureInfo.CurrentCulture); static bool IsAll(string p) => p.EndsWith("All", true, CultureInfo.CurrentCulture);
static bool IsNone(string p) => p.EndsWith("None", true, CultureInfo.CurrentCulture); static bool IsNone(string p) => p.EndsWith("None", true, CultureInfo.CurrentCulture);

View file

@ -3,12 +3,12 @@ using System.Collections.Generic;
namespace PKHeX.Core namespace PKHeX.Core
{ {
/// <summary> /// <summary>
/// Information wrapper used for Bulk Editing to apply suggested values. /// Information wrapper used for Batch Editing to apply suggested values.
/// </summary> /// </summary>
internal sealed class PKMInfo internal sealed class BatchInfo
{ {
internal PKM Entity { get; } internal PKM Entity { get; }
internal PKMInfo(PKM pk) { Entity = pk; } internal BatchInfo(PKM pk) => Entity = pk;
private LegalityAnalysis? la; private LegalityAnalysis? la;
internal LegalityAnalysis Legality => la ??= new LegalityAnalysis(Entity); internal LegalityAnalysis Legality => la ??= new LegalityAnalysis(Entity);
@ -16,4 +16,4 @@ namespace PKHeX.Core
public bool Legal => Legality.Valid; public bool Legal => Legality.Valid;
internal IReadOnlyList<int> SuggestedRelearn => Legality.GetSuggestedRelearnMoves(); internal IReadOnlyList<int> SuggestedRelearn => Legality.GetSuggestedRelearnMoves();
} }
} }