Пример #1
0
        private ThirdGenScenarioMeta LoadScenario(IReader reader, BuildInformation buildInfo)
        {
            if (!buildInfo.HasLayout("scnr"))
                return null;
            ITag scnr = FindTagByClass(ScnrMagic);
            if (scnr == null)
                throw new InvalidOperationException("The cache file is missing a scnr tag.");

            reader.SeekTo(scnr.MetaLocation.AsOffset());
            StructureValueCollection values = StructureReader.ReadStructure(reader, buildInfo.GetLayout("scnr"));
            return new ThirdGenScenarioMeta(values, reader, _header.MetaPointerConverter, _stringIds, buildInfo);
        }
Пример #2
0
 private void FindLanguageTable(BuildInformation buildInfo, out ITag tag, out StructureLayout layout)
 {
     // Check for a PATG tag, and if one isn't found, then use MATG
     tag = null;
     layout = null;
     if (buildInfo.HasLayout("patg"))
     {
         tag = FindTagByClass(PatgMagic);
         layout = buildInfo.GetLayout("patg");
     }
     if (tag == null)
     {
         tag = FindTagByClass(MatgMagic);
         layout = buildInfo.GetLayout("matg");
     }
     if (tag == null || layout == null)
         throw new InvalidOperationException("The cache file is missing locale information.");
 }