public IGameController GetGameBasedController(Game game, LibraryPlugin plugin) { if (game.IsCustomGame) { return(new GenericGameController(game)); } else { return(plugin.GetGameController(game.GetClone()) ?? new GenericGameController(game)); } logger.Error($"Unable to find controller responsible for {game.Name} game."); return(null); }
public Game ImportGame(GameMetadata game, LibraryPlugin sourcePlugin) { throw new NotImplementedException(); }
public static string GetDefaultIcon(this Game game, PlayniteSettings settings, GameDatabase database, LibraryPlugin plugin) { if (settings.DefaultIconSource == DefaultIconSourceOptions.None) { return(null); } else if (settings.DefaultIconSource == DefaultIconSourceOptions.Library && plugin?.LibraryIcon.IsNullOrEmpty() == false) { return(plugin.LibraryIcon); } else if (settings.DefaultIconSource == DefaultIconSourceOptions.Platform && game.Platform?.Icon.IsNullOrEmpty() == false) { return(database.GetFullFilePath(game.Platform.Icon)); } return(null); }