public static IEnumerable <EncounterTrade> GetValidEncounterTrades(PKM pkm, EvoCriteria[] chain) { // Pre-filter for some language scenarios int lang = pkm.Language; if (lang == (int)LanguageID.UNUSED_6) // invalid language { return(Array.Empty <EncounterTrade>()); } if (lang == (int)LanguageID.Hacked && !EncounterTrade5PID.IsValidMissingLanguage(pkm)) // Japanese trades in BW have no language ID { return(Array.Empty <EncounterTrade>()); } var game = (GameVersion)pkm.Version; var table = GetTable(game); return(GetValidEncounterTrades(pkm, chain, table)); }
public static IEnumerable <EncounterTrade> GetValidEncounterTrades(PKM pkm, IReadOnlyList <DexLevel> chain, GameVersion game = Any) { if (game == Any) { game = (GameVersion)pkm.Version; } int lang = pkm.Language; if (lang == (int)LanguageID.UNUSED_6) // invalid language { return(Array.Empty <EncounterTrade>()); } if (lang == (int)LanguageID.Hacked && !EncounterTrade5PID.IsValidMissingLanguage(pkm)) // Japanese trades in BW have no language ID { return(Array.Empty <EncounterTrade>()); } var poss = GetPossible(chain, game); return(GetValidEncounterTrades(pkm, chain, poss)); }