Example #1
0
 public IEnumerable <ASClass> GetClasses(ASMultiname multiname)
 {
     if (multiname == null || !_classesCache.TryGetValue(multiname, out List <ASClass> classes))
     {
         yield break;
     }
     for (int i = 0; i < classes.Count; i++)
     {
         ASClass @class = classes[i];
         if (@class.QName != multiname)
         {
             i--;
             classes.RemoveAt(i);
             if (!_classesCache.TryGetValue(@class.QName, out List <ASClass> newClasses))
             {
                 newClasses = new List <ASClass>();
                 _classesCache.Add(@class.QName, newClasses);
             }
             newClasses.Add(@class);
         }
         else
         {
             yield return(@class);
         }
     }
 }
Example #2
0
        private ASClass ReadClass(int index)
        {
            var @class = new ASClass(this, _input);

            @class.InstanceIndex = index;

            if (!_classesCache.TryGetValue(@class.QName, out List <ASClass> classes))
            {
                classes = new List <ASClass>();
                _classesCache.Add(@class.QName, classes);
            }

            classes.Add(@class);
            return(@class);
        }
Example #3
0
 public int AddClass(ASClass @class, ASInstance instance, bool recycle = true)
 {
     AddValue(Classes, @class, recycle);
     return(AddValue(Instances, instance, recycle));
 }