示例#1
0
 private void Add(CachedTagInstance tag)
 {
     if (tag != null)
     {
         Tags.Add(BlamCache.GetIndexItemFromID(tag.Index));
     }
 }
示例#2
0
        private void CopyTagNames(Stream cacheStream, object edDef, TagStructureInfo edInfo, object blamDef, TagStructureInfo blamInfo)
        {
            foreach (var blamField in TagStructure.GetTagFieldEnumerable(blamInfo.Types[0], blamInfo.Version))
            {
                foreach (var edField in TagStructure.GetTagFieldEnumerable(edInfo.Types[0], edInfo.Version))
                {
                    if (blamField.FieldType != edField.FieldType || edField.FieldInfo.Name != blamField.FieldInfo.Name)
                    {
                        continue;
                    }

                    var blamValue = blamField.FieldInfo.GetValue(blamDef);
                    var edValue   = edField.FieldInfo.GetValue(edDef);

                    if (blamValue is CachedTagInstance blamRef && edValue is CachedTagInstance edRef)
                    {
                        if (blamRef != null && edRef != null && blamRef.IsInGroup(edRef.Group))
                        {
                            CopyTagNames(cacheStream, edRef, BlamCache.GetIndexItemFromID(blamRef.Index));
                        }
                    }