コード例 #1
0
        public static void Diff(
            EntityMap left,
            EntityMap right,
            IEntityMapCompareHandler handler,
            string staticsticId = "",
            IGameEntityComparator gameEntityComparator = null, bool skipMissHandle = false)
        {
            if (gameEntityComparator == null)
            {
                gameEntityComparator = new GameEntityComparator(handler);
            }

            EntityMapComparaeStatisticOne oneStat = UnsortedEntityMapComparator.Diff(left, right, handler, gameEntityComparator, skipMissHandle);

            RecordStatistics(staticsticId, oneStat);
        }
コード例 #2
0
        public static void Diff(
            EntityMap left,
            EntityMap right,
            IEntityMapDiffHandler handler,
            string staticsticId,
            IGameEntityCompareAgent gameEntityComparator, bool skipMissHandle = false)
        {
            if (gameEntityComparator == null)
            {
                gameEntityComparator = new GameEntityDefaultCompareAgent(handler);
            }

            EntityMapComparaeStatisticOne oneStat = Diff(left, right, handler, gameEntityComparator, skipMissHandle);

            RecordStatistics(staticsticId, oneStat);
        }
コード例 #3
0
        private static void RecordStatistics(string staticsticId, EntityMapComparaeStatisticOne oneStat)
        {
            EntityMapComparaeStatisticTotal totalStat;

            if (!_statistics.TryGetValue(staticsticId, out totalStat))
            {
                totalStat = new EntityMapComparaeStatisticTotal();
                _statistics[staticsticId] = totalStat;
            }

            totalStat.TotalComponentCount += oneStat.ComponentCount;
            totalStat.TotalEntityCount    += oneStat.EntityCount;
            totalStat.LastComponentCount   = oneStat.ComponentCount;
            totalStat.LastEntityCount      = oneStat.EntityCount;
            totalStat.LastCreateTime       = oneStat.CreateTime;
            totalStat.LastInterval         = oneStat.Interval;
            totalStat.TotalInterval        = oneStat.Interval;
        }