private static void AddWorldMods(object user_data, List <SettingLevel> levels) { string path = FileSystem.Normalize(System.IO.Path.Combine(SettingsCache.GetPath(), "worlds")); ListPool <string, CustomGameSettings> .PooledList pooledList = ListPool <string, CustomGameSettings> .Allocate(); FileSystem.GetFiles(path, "*.yaml", pooledList); foreach (string item in pooledList) { ProcGen.World world = YamlIO.LoadFile <ProcGen.World>(item, null, null); string worldName = Worlds.GetWorldName(item); string id = worldName; string name = world.name; string description = world.description; levels.Add(new SettingLevel(id, name, description, 0, user_data)); } pooledList.Recycle(); }