Example #1
0
        private bool SaveStatisticsSupported(ISourcePort sourcePort)
        {
            if (BoomStatsReader.Supported(sourcePort))
            {
                return(true);
            }
            if (ZDoomStatsReader.Supported(sourcePort))
            {
                return(true);
            }
            if (CNDoomStatsReader.Supported(sourcePort))
            {
                return(true);
            }

            return(false);
        }
        private IStatisticsReader CreateStatisticsReader(ISourcePort sourcePort, IGameFile gameFile)
        {
            IStatisticsReader statsReader = null;

            if (BoomStatsReader.Supported(sourcePort))
            {
                statsReader = BoomStatsReader.CreateDefault(gameFile, sourcePort.Directory.GetFullPath());
            }
            else if (CNDoomStatsReader.Supported(sourcePort))
            {
                statsReader = CNDoomStatsReader.CreateDefault(gameFile, sourcePort.Directory.GetFullPath());
            }
            else if (ZDoomStatsReader.Supported(sourcePort))
            {
                List <IStatsData> existingStats = new List <IStatsData>();
                if (gameFile != null && gameFile.GameFileID.HasValue)
                {
                    existingStats = DataSourceAdapter.GetStats(gameFile.GameFileID.Value).ToList();
                }
                statsReader = ZDoomStatsReader.CreateDefault(gameFile, sourcePort.Directory.GetFullPath(), existingStats);
            }

            return(statsReader);
        }
Example #3
0
 private bool SaveStatisticsSupported(ISourcePortDataSource sourcePort) =>
 (BoomStatsReader.Supported(sourcePort) || (ZDoomStatsReader.Supported(sourcePort) || CNDoomStatsReader.Supported(sourcePort)));