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); } } }
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); }
public int AddClass(ASClass @class, ASInstance instance, bool recycle = true) { AddValue(Classes, @class, recycle); return(AddValue(Instances, instance, recycle)); }