示例#1
0
        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();
 }
示例#3
0
        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);
        }