use of jack.rm.plugins.types.ProviderPlugin in project rom-manager by Jakz.
the class GameSetManager method buildRomsetList.
@SuppressWarnings("unchecked")
public void buildRomsetList() {
Set<ActualPluginBuilder> parsers = manager.getBuildersByType(PluginRealType.DAT_PARSER);
List<DatParserPlugin> datParsers = parsers.stream().map(b -> (DatParserPlugin) manager.build((Class<DatParserPlugin>) b.getID().getType())).collect(Collectors.toList());
Set<ActualPluginBuilder> builders = manager.getBuildersByType(PluginRealType.PROVIDER);
logger.d("Building available rom sets");
logger.ld("Found %d dat parsers: %s", () -> datParsers.size(), () -> datParsers.stream().map(p -> Arrays.toString(p.getSupportedFormats())).collect(Collectors.joining(", ")));
for (ActualPluginBuilder builder : builders) {
ProviderPlugin plugin = (ProviderPlugin) manager.build((Class<ProviderPlugin>) builder.getID().getType());
logger.d("Found ProviderPlugin: %s", plugin.getClass().getName());
GameSet[] rsets = plugin.buildRomSets(datParsers);
for (GameSet set : rsets) {
helpers.put(set, new MyGameSetFeatures(set));
List<GameSet> setsForPlatform = sets.computeIfAbsent(set.platform(), s -> new ArrayList<>());
setsForPlatform.add(set);
}
}
for (Platform platform : Platforms.values()) sets.computeIfAbsent(platform, s -> new ArrayList<>());
}
Aggregations