コード例 #1
0
        private void OnParseCompleted(ParsingContext context, ParsingStatistics statistics)
        {
            var percentage = 100.0f * statistics.ParsedPacketCount / statistics.PacketCount;

            _parseStatusText.Text = $"Processed packets: {statistics.ParsedPacketCount:N0} / {statistics.PacketCount:N0} ({percentage:F2}%). Elapsed time: {statistics.ExecutionTime}.";

            var entities = context.ObjectManager.AsCollection();

            _unitDisplayControl.Model.Objects   = entities.OfType <Creature>();
            _playerDisplayControl.Model.Objects = entities.OfType <Player>();
        }
コード例 #2
0
        private ParsingStatistics GenerateStatistics()
        {
            ParsingStatistics statistics = new ParsingStatistics
            {
                TotalGamesToExctract = GameEntries.Count
            };

            foreach (GameEntry ge in GameEntries)
            {
                if (ge.IsMultidisc)
                {
                    foreach (MultidiscEntry mde in ge.MultidiscRefs)
                    {
                        statistics.TotalArchives++;
                        statistics.TotalArchivesSizeInMB += mde.DiscSizeInMB;
                        if (ge.ToExtract)
                        {
                            statistics.TotalArchivesToExtract++;
                            statistics.TotalArchivesToExtractSizeInMB += mde.DiscSizeInMB;
                        }
                    }
                }
                else
                {
                    statistics.TotalArchives++;
                    statistics.TotalArchivesSizeInMB += ge.Size;
                    if (ge.ToExtract)
                    {
                        statistics.TotalArchivesToExtract++;
                        statistics.TotalArchivesToExtractSizeInMB += ge.Size;
                    }
                }
            }

            return(statistics);
        }