mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Rename internal PKMInfo class to match batch names
This commit is contained in:
parent
d9c22b1d74
commit
9dfa1077ee
2 changed files with 11 additions and 11 deletions
|
@ -225,7 +225,7 @@ namespace PKHeX.Core
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to modify the <see cref="PKMInfo"/>.
|
||||
/// Tries to modify the <see cref="BatchInfo"/>.
|
||||
/// </summary>
|
||||
/// <param name="pk">Command Filter</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)
|
||||
return ModifyResult.Invalid;
|
||||
|
||||
var info = new PKMInfo(pk);
|
||||
var info = new BatchInfo(pk);
|
||||
var pi = Props[Array.IndexOf(Types, pk.GetType())];
|
||||
foreach (var cmd in filters)
|
||||
{
|
||||
|
@ -276,13 +276,13 @@ namespace PKHeX.Core
|
|||
}
|
||||
|
||||
/// <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>
|
||||
/// <param name="cmd">Command Filter</param>
|
||||
/// <param name="info">Pokémon to check.</param>
|
||||
/// <param name="props">PropertyInfo cache (optional)</param>
|
||||
/// <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;
|
||||
if (cmd.PropertyValue.StartsWith(CONST_BYTES))
|
||||
|
@ -308,13 +308,13 @@ namespace PKHeX.Core
|
|||
}
|
||||
|
||||
/// <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>
|
||||
/// <param name="cmd">Command Filter</param>
|
||||
/// <param name="info">Pokémon to check.</param>
|
||||
/// <param name="props">PropertyInfo cache (optional)</param>
|
||||
/// <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))
|
||||
return true;
|
||||
|
@ -390,7 +390,7 @@ namespace PKHeX.Core
|
|||
/// <param name="name">Property to modify.</param>
|
||||
/// <param name="info">Cached info storing Legal data.</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 IsNone(string p) => p.EndsWith("None", true, CultureInfo.CurrentCulture);
|
||||
|
|
|
@ -3,12 +3,12 @@ using System.Collections.Generic;
|
|||
namespace PKHeX.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Information wrapper used for Bulk Editing to apply suggested values.
|
||||
/// Information wrapper used for Batch Editing to apply suggested values.
|
||||
/// </summary>
|
||||
internal sealed class PKMInfo
|
||||
internal sealed class BatchInfo
|
||||
{
|
||||
internal PKM Entity { get; }
|
||||
internal PKMInfo(PKM pk) { Entity = pk; }
|
||||
internal BatchInfo(PKM pk) => Entity = pk;
|
||||
|
||||
private LegalityAnalysis? la;
|
||||
internal LegalityAnalysis Legality => la ??= new LegalityAnalysis(Entity);
|
||||
|
@ -16,4 +16,4 @@ namespace PKHeX.Core
|
|||
public bool Legal => Legality.Valid;
|
||||
internal IReadOnlyList<int> SuggestedRelearn => Legality.GetSuggestedRelearnMoves();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue