예제 #1
0
        public virtual APlaced Duplicate(
            IAPlacedGetter item,
            FormKey formKey,
            TranslationCrystal?copyMask)
        {
            var newRec = new APlaced(formKey, default(Fallout4Release));

            newRec.DeepCopyIn(item, default(ErrorMaskBuilder?), copyMask);
            return(newRec);
        }
예제 #2
0
        public APlaced DeepCopy(
            IAPlacedGetter item,
            APlaced.TranslationMask?copyMask = null)
        {
            APlaced ret = (APlaced)((APlacedCommon)((IAPlacedGetter)item).CommonInstance() !).GetNew();

            ((APlacedSetterTranslationCommon)((IAPlacedGetter)ret).CommonSetterTranslationInstance() !).DeepCopyIn(
                item: ret,
                rhs: item,
                errorMask: null,
                copyMask: copyMask?.GetCrystal(),
                deepCopy: true);
            return(ret);
        }
예제 #3
0
        public APlaced DeepCopy(
            IAPlacedGetter item,
            ErrorMaskBuilder?errorMask,
            TranslationCrystal?copyMask = null)
        {
            APlaced ret = (APlaced)((APlacedCommon)((IAPlacedGetter)item).CommonInstance() !).GetNew();

            ((APlacedSetterTranslationCommon)((IAPlacedGetter)ret).CommonSetterTranslationInstance() !).DeepCopyIn(
                item: ret,
                rhs: item,
                errorMask: errorMask,
                copyMask: copyMask,
                deepCopy: true);
            return(ret);
        }
예제 #4
0
        public APlaced DeepCopy(
            IAPlacedGetter item,
            out APlaced.ErrorMask errorMask,
            APlaced.TranslationMask?copyMask = null)
        {
            var     errorMaskBuilder = new ErrorMaskBuilder();
            APlaced ret = (APlaced)((APlacedCommon)((IAPlacedGetter)item).CommonInstance() !).GetNew();

            ((APlacedSetterTranslationCommon)((IAPlacedGetter)ret).CommonSetterTranslationInstance() !).DeepCopyIn(
                ret,
                item,
                errorMask: errorMaskBuilder,
                copyMask: copyMask?.GetCrystal(),
                deepCopy: true);
            errorMask = APlaced.ErrorMask.Factory(errorMaskBuilder);
            return(ret);
        }
예제 #5
0
        public void DisableAPI()
        {
            // Some calls assuring the Disable() API is accessible and working.
            SkyrimMod    sourceMod    = new SkyrimMod(Utility.PluginModKey, SkyrimRelease.SkyrimSE);
            FormKey      key          = sourceMod.GetNextFormKey();
            PlacedObject placedObject = new PlacedObject(key, SkyrimRelease.SkyrimSE);

            // Simplistic Disable access and verification.
            PlacedObject disabledObj = placedObject;

            disabledObj.Disable();
            //_testOutputHelper.WriteLine($"{disabledPlacedObject.MajorRecordFlagsRaw}");
            Assert.True(EnumExt.HasFlag(disabledObj.MajorRecordFlagsRaw, Constants.InitiallyDisabled));
            MajorRecord majorRecord = placedObject;

            majorRecord.Disable();
            Assert.True(EnumExt.HasFlag(majorRecord.MajorRecordFlagsRaw, Constants.InitiallyDisabled));
            IMajorRecordCommon interfaceRecord = placedObject;

            interfaceRecord.Disable();
            Assert.True(EnumExt.HasFlag(interfaceRecord.MajorRecordFlagsRaw, Constants.InitiallyDisabled));
            IPlaced interfacePlaced = placedObject;

            interfacePlaced.Disable();
            Assert.True(EnumExt.HasFlag(interfacePlaced.MajorRecordFlagsRaw, Constants.InitiallyDisabled));

            // Sanity test both API are invokable under Placed context.
            PlacedTrap placedTrap = new PlacedTrap(key, SkyrimRelease.SkyrimSE);

            placedTrap.Disable(IPlaced.DisableType.DisableWithoutZOffset);
            interfacePlaced = placedTrap;
            interfacePlaced.Disable(IPlaced.DisableType.JustInitiallyDisabled);
            APlaced abstractPlaced = placedTrap;

            abstractPlaced.Disable();
            abstractPlaced.Disable(IPlaced.DisableType.SafeDisable);

            //Try any other object other than Placed (invoke MajorRecord.Disable() and see if it works)
            var armor = new Armor(key, SkyrimRelease.SkyrimSE);

            armor.Disable();
            Assert.True(EnumExt.HasFlag(armor.MajorRecordFlagsRaw, Constants.InitiallyDisabled));
        }
예제 #6
0
 public override object GetNew()
 {
     return(APlaced.GetNew());
 }
예제 #7
0
 partial void PostDuplicate(APlaced obj, APlaced rhs, Func <FormKey> getNextFormKey, IList <(IMajorRecordCommon Record, FormKey OriginalFormKey)>?duplicatedRecords);