Minor clean

This commit is contained in:
Kurt 2021-01-03 16:53:13 -08:00
parent 33ad654be6
commit 730640decc
4 changed files with 5 additions and 23 deletions

View file

@ -285,12 +285,9 @@ namespace PKHeX.Core
if (pkm.Species == (int)Species.Shedinja && info.Generation <= 4)
ParseShedinjaEvolveMoves(pkm, res, source.CurrentMoves, info.EvoChainsAllGens);
// ReSharper disable once ConstantNullCoalescingCondition
for (int m = 0; m < 4; m++)
{
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if (res[m] == null)
res[m] = new CheckMoveResult(Unknown, info.Generation, Invalid, LMoveSourceInvalid, Move);
}
res[m] ??= new CheckMoveResult(Unknown, info.Generation, Invalid, LMoveSourceInvalid, Move);
return res;
}

View file

@ -18,6 +18,7 @@ namespace PKHeX.Core
(int)Species.Kingdra,
(int)Species.Porygon2,
(int)Species.Blissey,
(int)Species.Magnezone,
(int)Species.Lickilicky,
(int)Species.Rhyperior,

View file

@ -1,17 +1,10 @@
using System.Collections.Generic;
namespace PKHeX.Core
namespace PKHeX.Core
{
public interface IVersion
{
GameVersion Version { get; }
}
internal interface IVersionSet
{
GameVersion Version { set; }
}
public static partial class Extensions
{
private static bool CanBeReceivedBy(this IVersion ver, GameVersion game) => ver.Version.Contains(game);
@ -23,15 +16,6 @@ namespace PKHeX.Core
return ver.GetSingleVersion();
}
internal static void SetVersion<T>(this IEnumerable<T> arr, GameVersion game) where T : IVersion, IVersionSet
{
foreach (var z in arr)
{
if (((IVersion)z).Version <= 0)
((IVersionSet)z).Version = game;
}
}
private static GameVersion GetSingleVersion(this IVersion ver)
{
const int max = (int) GameVersion.RB;

View file

@ -487,7 +487,7 @@ namespace PKHeX.Core
#region Pokédex
public int PokeDex { get; protected set; } = int.MinValue;
public virtual bool HasPokeDex => PokeDex > -1;
public bool HasPokeDex => PokeDex > -1;
public virtual bool GetSeen(int species) => false;
public virtual void SetSeen(int species, bool seen) { }
public virtual bool GetCaught(int species) => false;