Пример #1
0
 private static IEnumerable <IEncounterable> GetPossibleOfType(PKM pk, IReadOnlyCollection <int> needs, GameVersion version, EncounterOrder type)
 {
     return(type switch
     {
         EncounterOrder.Egg => GetEggs(pk, needs, version),
         EncounterOrder.Mystery => GetGifts(pk, needs),
         EncounterOrder.Static => GetStatic(pk, needs),
         EncounterOrder.Trade => GetTrades(pk, needs),
         EncounterOrder.Slot => GetSlots(pk, needs),
         _ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
     });
Пример #2
0
        private static IEnumerable <IEncounterable> GetPossibleOfType(PKM pk, IReadOnlyCollection <int> needs, GameVersion version, EncounterOrder type)
        {
            switch (type)
            {
            case EncounterOrder.Egg: return(GetEggs(pk, needs, version));

            case EncounterOrder.Mystery: return(GetGifts(pk, needs));

            case EncounterOrder.Link: return(GetLink(pk, needs));

            case EncounterOrder.Static: return(GetStatic(pk, needs));

            case EncounterOrder.Trade: return(GetTrades(pk, needs));

            case EncounterOrder.Slot: return(GetSlots(pk, needs));

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }