Merge extended property patterns

This commit is contained in:
Kurt 2021-12-04 18:37:47 -08:00
parent 88ddc5822e
commit 40ed5898af
4 changed files with 4 additions and 4 deletions

View file

@ -373,7 +373,7 @@ namespace PKHeX.Core
IEnumerable<int> em = trade.Moves; IEnumerable<int> em = trade.Moves;
if (trade.Generation <= 2) if (trade.Generation <= 2)
em = em.Concat(MoveLevelUp.GetEncounterMoves(trade.Species, 0, trade.Level, trade.Version)); em = em.Concat(MoveLevelUp.GetEncounterMoves(trade.Species, 0, trade.Level, trade.Version));
else if (trade is IRelearn { Relearn: { Count: not 0 } } r) else if (trade is IRelearn { Relearn.Count: not 0 } r)
em = em.Concat(r.Relearn); em = em.Concat(r.Relearn);
if (!needs.Except(em).Any()) if (!needs.Except(em).Any())
yield return trade; yield return trade;

View file

@ -146,7 +146,7 @@ namespace PKHeX.Core
var games = enc.Generation == 1 ? GBRestrictions.GetGen1Versions(enc) : GBRestrictions.GetGen2Versions(enc, pkm.Korean); var games = enc.Generation == 1 ? GBRestrictions.GetGen1Versions(enc) : GBRestrictions.GetGen2Versions(enc, pkm.Korean);
foreach (var ver in games) foreach (var ver in games)
{ {
var VerInitialMoves = enc is IMoveset {Moves: {Count: not 0}} x ? (int[])x.Moves : MoveLevelUp.GetEncounterMoves(enc.Species, 0, level, ver); var VerInitialMoves = enc is IMoveset {Moves.Count: not 0 } x ? (int[])x.Moves : MoveLevelUp.GetEncounterMoves(enc.Species, 0, level, ver);
if (VerInitialMoves.Intersect(InitialMoves).Count() == VerInitialMoves.Length) if (VerInitialMoves.Intersect(InitialMoves).Count() == VerInitialMoves.Length)
return res; return res;

View file

@ -214,7 +214,7 @@ namespace PKHeX.Core
if (capsuleState != TimeCapsuleEvaluation.NotTransferred) // No Move Deleter in Gen 1 if (capsuleState != TimeCapsuleEvaluation.NotTransferred) // No Move Deleter in Gen 1
return 1; // Move Deleter exits, slots from 2 onwards can always be empty return 1; // Move Deleter exits, slots from 2 onwards can always be empty
if (enc is IMoveset {Moves: {Count: 4}}) if (enc is IMoveset {Moves.Count: 4 })
return 4; return 4;
int required = GetRequiredMoveCount(pk, moves, info.EncounterMoves.LevelUpMoves, initialmoves, enc.Species); int required = GetRequiredMoveCount(pk, moves, info.EncounterMoves.LevelUpMoves, initialmoves, enc.Species);

View file

@ -288,7 +288,7 @@ namespace PKHeX.Core
} }
for (int i = 8; i < 11; i++) // 3 PCD for (int i = 8; i < 11; i++) // 3 PCD
{ {
if (value[i] is PCD {Gift: {CardType: not 0}}) if (value[i] is PCD {Gift.CardType: not 0 })
return true; return true;
} }
return false; return false;