Ejemplo n.º 1
0
        public void WriteWithCounterLists()
        {
            var param = new BinaryWriteParameters()
            {
                ModKey             = BinaryWriteParameters.ModKeyOption.NoCheck,
                MastersListContent = BinaryWriteParameters.MastersListContentOption.Iterate,
            };

            using var tmp = GetFile();
            var mod   = new SkyrimMod(WriteKey, SkyrimRelease.SkyrimLE);
            var armor = mod.Armors.AddNew();

            mod.WriteToBinaryParallel(tmp.File.Path, param);
            armor.Keywords = new ExtendedList <IFormLinkGetter <IKeywordGetter> >();
            mod.WriteToBinaryParallel(tmp.File.Path, param);
            armor.Keywords.Add(FormKey.Null);
            mod.WriteToBinaryParallel(tmp.File.Path, param);
            for (int i = 0; i < 20000; i++)
            {
                armor.Keywords.Add(FormKey.Null);
            }
            Assert.Throws <AggregateException>(() =>
            {
                mod.WriteToBinaryParallel(tmp.File.Path, param);
            });
        }
Ejemplo n.º 2
0
 private ModHeaderWriteLogic(
     BinaryWriteParameters?param,
     IModGetter mod,
     IModHeaderCommon modHeader)
 {
     _params     = param ?? BinaryWriteParameters.Default;
     _modKey     = mod.ModKey;
     _nextFormID = modHeader.MinimumCustomFormID;
 }