예제 #1
0
 // Utility
 private static bool IsEncounterTypeMatch(IEncounterable e, int type)
 {
     return(e switch
     {
         EncounterStaticTyped t => t.TypeEncounter.Contains(type),
         EncounterSlot4 w => w.TypeEncounter.Contains(type),
         _ => (type == 0)
     });
예제 #2
0
        private static EncounterType GetEncounterTypeValue(PKM pkm, IEncounterable enc)
        {
            // Encounter type data is only stored for gen 4 encounters
            // All eggs have encounter type none, even if they are from static encounters
            if (enc.Generation != 4 || pkm.Egg_Location != 0)
            {
                return(EncounterType.None);
            }

            return(enc switch
            {
                EncounterSlot4 w => w.TypeEncounter,
                EncounterStaticTyped s => s.TypeEncounter,
                _ => EncounterType.None
            });