Exemplo n.º 1
0
        public static IEnumerable <PKM> GetCompatible(this SaveFile SAV, IEnumerable <PKM> pks)
        {
            var savtype = SAV.PKMType;

            foreach (var temp in pks)
            {
                var pk = PKMConverter.ConvertToType(temp, savtype, out string c);
                if (pk == null)
                {
                    Debug.WriteLine(c);
                    continue;
                }

                if (PKMConverter.IsIncompatibleGB(pk.Format, SAV.Japanese, pk.Japanese))
                {
                    c = PKMConverter.GetIncompatibleGBMessage(pk, SAV.Japanese);
                    Debug.WriteLine(c);
                    continue;
                }

                var compat = SAV.IsPKMCompatible(pk);
                if (compat.Count > 0)
                {
                    continue;
                }

                yield return(pk);
            }
        }
Exemplo n.º 2
0
        public static IEnumerable <PKM> GetCompatible(this SaveFile sav, IEnumerable <PKM> pks)
        {
            var savtype = sav.PKMType;

            foreach (var temp in pks)
            {
                var pk = PKMConverter.ConvertToType(temp, savtype, out string c);
                if (pk == null)
                {
                    Debug.WriteLine(c);
                    continue;
                }

                if (sav is ILangDeviantSave il && PKMConverter.IsIncompatibleGB(temp, il.Japanese, pk.Japanese))
                {
                    c = PKMConverter.GetIncompatibleGBMessage(pk, il.Japanese);
                    Debug.WriteLine(c);
                    continue;
                }

                var compat = sav.IsPKMCompatible(pk);
                if (compat.Count > 0)
                {
                    continue;
                }

                yield return(pk);
            }
        }