Example #1
0
 public GameAssetType(WrathEdXML.AssetDefinition.GameAssetType asset)
     : base(asset)
 {
     if (asset.Entries != null)
     {
         Entries = new BaseEntryType[asset.Entries.Length];
         for (int idx = 0; idx < Entries.Length; ++idx)
         {
             Type entryType = asset.Entries[idx].GetType();
             if (entryType == typeof(WrathEdXML.AssetDefinition.EntryPoidType))
             {
                 Entries[idx] = new EntryPoidType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryPoidType);
             }
             else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryFileType))
             {
                 Entries[idx] = new EntryFileType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryFileType);
             }
             else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryReferenceType))
             {
                 Entries[idx] = new EntryReferenceType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryReferenceType);
             }
             else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryWeakReferenceType))
             {
                 Entries[idx] = new EntryWeakReferenceType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryWeakReferenceType);
             }
             else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryType))
             {
                 Entries[idx] = new EntryType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryType);
             }
             else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryRelocationType))
             {
                 Entries[idx] = new EntryRelocationType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryRelocationType);
             }
             else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryListType))
             {
                 Entries[idx] = new EntryListType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryListType);
             }
             else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryChoiceType))
             {
                 Entries[idx] = new EntryChoiceType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryChoiceType);
             }
             else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryInheritanceType))
             {
                 Entries[idx] = new EntryInheritanceType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryInheritanceType);
             }
         }
     }
     if (asset.Runtime != null)
     {
         Runtime = new RuntimeType(asset.Runtime);
     }
     TypeHash = asset.TypeHash;
     HasSpecialCompileHandling = asset.HasSpecialCompileHandling;
 }
Example #2
0
 public AssetType(WrathEdXML.AssetDefinition.AssetType asset)
     : base(asset)
 {
     if (asset.Entries == null)
     {
         return;
     }
     Entries = new BaseEntryType[asset.Entries.Length];
     for (int idx = 0; idx < Entries.Length; ++idx)
     {
         Type entryType = asset.Entries[idx].GetType();
         if (entryType == typeof(WrathEdXML.AssetDefinition.EntryPoidType))
         {
             Entries[idx] = new EntryPoidType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryPoidType);
         }
         else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryFileType))
         {
             Entries[idx] = new EntryFileType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryFileType);
         }
         else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryReferenceType))
         {
             Entries[idx] = new EntryReferenceType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryReferenceType);
         }
         else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryWeakReferenceType))
         {
             Entries[idx] = new EntryWeakReferenceType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryWeakReferenceType);
         }
         else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryType))
         {
             Entries[idx] = new EntryType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryType);
         }
         else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryRelocationType))
         {
             Entries[idx] = new EntryRelocationType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryRelocationType);
         }
         else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryListType))
         {
             Entries[idx] = new EntryListType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryListType);
         }
         else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryChoiceType))
         {
             Entries[idx] = new EntryChoiceType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryChoiceType);
         }
         else if (entryType == typeof(WrathEdXML.AssetDefinition.EntryInheritanceType))
         {
             Entries[idx] = new EntryInheritanceType(asset.Entries[idx] as WrathEdXML.AssetDefinition.EntryInheritanceType);
         }
     }
 }