Ejemplo n.º 1
0
        public static List <string> GetAliveBattleTypes()
        {
            WeakReferenceInfo.Cleanup();

            var list = WeakReferenceInfo.weakReferencesBattle.Select(x => {
                var typeName = x.type.FullName;
                return(string.IsNullOrEmpty(x.comment) == true ? typeName : typeName + " = " + x.comment);
            }).ToList();

            return(list);
        }
Ejemplo n.º 2
0
        public static Dictionary <string, string> CompareTypenames()
        {
            WeakReferenceInfo.Cleanup();

            var dict1 = new Dictionary <System.Type, int>();
            var dict2 = new Dictionary <System.Type, int>();

            for (var i = 0; i < WeakReferenceInfo.weakReferences.Count; ++i)
            {
                var type = WeakReferenceInfo.weakReferences[i].type;
                if (dict1.ContainsKey(type) == true)
                {
                    ++dict1[type];
                }
                else
                {
                    dict1.Add(type, 1);
                }
            }

            for (var i = 0; i < WeakReferenceInfo.weakReferencesTemp.Count; ++i)
            {
                var type = WeakReferenceInfo.weakReferencesTemp[i].type;
                if (dict2.ContainsKey(type) == true)
                {
                    ++dict2[type];
                }
                else
                {
                    dict2.Add(type, 1);
                }
            }

            var compare = new Dictionary <string, string>();

            foreach (var pair in dict2)
            {
                int value;
                if (dict1.TryGetValue(pair.Key, out value) == false)
                {
                    continue;
                }
                var diff = value - pair.Value;
                if (diff == 0)
                {
                    continue;
                }

                compare.Add(pair.Key.FullName, string.Format("{0}-{1}={2}", value, pair.Value, diff));
            }

            return(compare);
        }
Ejemplo n.º 3
0
        public static void Save()
        {
            WeakReferenceInfo.Cleanup();

            WeakReferenceInfo.weakReferencesTemp = new List <WeakReferenceInfo>(WeakReferenceInfo.weakReferences);
        }
Ejemplo n.º 4
0
        public static int GetAliveTypesCount()
        {
            WeakReferenceInfo.Cleanup();

            return(WeakReferenceInfo.weakReferences.Count);
        }