public static void Write()
        {
            string         buildPath      = DataDirectory.GetBuildPath();
            Build          build          = new Build(buildPath);
            BuildTarget    qfBuildTarget  = BuildTargetFactory.Construct(BuildTargetFactory.QFName, build);
            BuildTarget    tifBuildTarget = BuildTargetFactory.Construct(BuildTargetFactory.TIFName, build);
            TES4Collection collection     = TES4CollectionFactory.Create(DataDirectory.GetESMDirectoryPath(), DataDirectory.TES4GameFileName);//Needs the "full" collection for SCRO lookups.

            using (ESMAnalyzer esmAnalyzer = ESMAnalyzer.Load(collection))
            {
                foreach (TES4Record record in collection.Where(r => r.RecordType == TES4RecordType.INFO))
                {
                    var      scroRecords = esmAnalyzer.GetTypesFromSCROEnumerable(record, null);
                    string[] aliases     = scroRecords.Select(r => r.Key).ToArray();
                    Write(qfBuildTarget, tifBuildTarget, record, null, aliases);
                }
                foreach (TES4Record record in collection.GetGrupRecords(TES4RecordType.QUST))
                {
                    Dictionary <StageIndexAndLogIndex, List <string> > aliasesDictionary = new Dictionary <StageIndexAndLogIndex, List <string> >();
                    foreach (var subrecord in record.GetSubrecordsWithStageIndexAndLogIndex("SCRO"))
                    {
                        int    formID = subrecord.Item1.Value.FirstFourBytesToInt();
                        string name   = formID == TES5PlayerReference.FormID ? TES5PlayerReference.PlayerRefName : esmAnalyzer.GetEDIDByFormID(formID);
                        aliasesDictionary.AddNewListIfNotContainsKeyAndAddValueToList(subrecord.Item2, name);
                    }
                    foreach (var aliases in aliasesDictionary)
                    {
                        Write(qfBuildTarget, tifBuildTarget, record, aliases.Key, aliases.Value);
                    }
                }
            }
        }
 private static TES4Collection GetESM()
 {
     return(TES4CollectionFactory.Create(DataDirectory.GetESMDirectoryPath(), DataDirectory.TES4GameFileName));
 }