using System.Collections.Generic; using System.Linq; using PKHeX.Core; namespace PKHeX.WinForms { public sealed class SaveBlockMetadata { private readonly Dictionary BlockList; public SaveBlockMetadata(ISaveBlockAccessor accessor) { var aType = accessor.GetType(); BlockList = aType.GetAllPropertiesOfType(accessor); } public IEnumerable GetSortedBlockList() { return BlockList.Select(z => z.Value).OrderBy(z => z); } public SaveBlock GetBlock(string name) => BlockList.First(z => z.Value == name).Key; } }