Example #1
0
        private static IEnumerable <int> GetValidMoves(PKM pkm, GameVersion version, IReadOnlyList <IReadOnlyList <EvoCriteria> > evoChains, int minLvLG1 = 1, int minLvLG2 = 1, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false, bool MoveReminder = true, bool RemoveTransferHM = true)
        {
            var r = new List <int> {
                0
            };

            if (Relearn && pkm.Format >= 6)
            {
                r.AddRange(pkm.RelearnMoves);
            }

            int start = pkm.GenNumber;

            if (start < 0)
            {
                start = pkm.Format; // be generous instead of returning nothing
            }
            if (pkm is IBattleVersion b)
            {
                start = b.GetMinGeneration();
            }

            for (int generation = start; generation <= pkm.Format; generation++)
            {
                var chain = evoChains[generation];
                if (chain.Count == 0)
                {
                    continue;
                }
                r.AddRange(MoveList.GetValidMoves(pkm, version, chain, generation, minLvLG1: minLvLG1, minLvLG2: minLvLG2, LVL: LVL, Relearn: false, Tutor: Tutor, Machine: Machine, MoveReminder: MoveReminder, RemoveTransferHM: RemoveTransferHM));
            }

            return(r.Distinct());
        }