private static IEnumerable <RegimenInfo> GetBooleanRegimenNames(ISuperTrain pkm, string propertyPrefix) { var names = ReflectUtil.GetPropertiesStartWithPrefix(pkm.GetType(), propertyPrefix); foreach (var name in names) { var value = ReflectUtil.GetValue(pkm, name); if (value is bool state) { yield return(new RegimenInfo(name, state)); } } }