Esempio n. 1
0
        public static GlobalFloat AddNewFloat(this IGroupCommon <Global> globals)
        {
            var ret = new GlobalFloat(
                globals.SourceMod.GetNextFormKey());

            globals.Add(ret);
            return(ret);
        }
Esempio n. 2
0
        public static GameSettingFloat AddNewFloat(this IGroupCommon <GameSetting> gameSettings)
        {
            var ret = new GameSettingFloat(
                gameSettings.SourceMod.GetNextFormKey());

            gameSettings.Add(ret);
            return(ret);
        }
Esempio n. 3
0
        public static GlobalShort AddNewShort(this IGroupCommon <Global> globals, string editorId)
        {
            var ret = new GlobalShort(
                globals.SourceMod.GetNextFormKey(editorId));

            globals.Add(ret);
            return(ret);
        }
Esempio n. 4
0
        public static GameSettingString AddNewShort(this IGroupCommon <GameSetting> gameSettings, string editorId)
        {
            var ret = new GameSettingString(
                gameSettings.SourceMod.GetNextFormKey(editorId));

            gameSettings.Add(ret);
            return(ret);
        }
Esempio n. 5
0
        public static GlobalShort AddNewShort(this IGroupCommon <Global> globals)
        {
            var ret = new GlobalShort(
                globals.SourceMod.GetNextFormKey(),
                globals.SourceMod.GameRelease.ToSkyrimRelease());

            globals.Add(ret);
            return(ret);
        }
Esempio n. 6
0
        public static GlobalInt AddNewInt(this IGroupCommon <Global> globals, string editorId)
        {
            var ret = new GlobalInt(
                globals.SourceMod.GetNextFormKey(editorId),
                globals.SourceMod.GameRelease.ToSkyrimRelease());

            globals.Add(ret);
            return(ret);
        }
Esempio n. 7
0
        /// <summary>
        /// Duplicates a given record (giving it a new FormID) adding it to the group and returning it.
        /// </summary>
        /// <param name="group">Group to add to</param>
        /// <param name="edid">EditorID to drive the FormID assignment off any persistance systems</param>
        /// <param name="source">Source record to duplicate</param>
        /// <returns>Duplicated and added record</returns>
        public static TMajor DuplicateIn <TMajor, TMajorGetter>(this IGroupCommon <TMajor> group, string edid, TMajorGetter source)
            where TMajor : IMajorRecordCommon, TMajorGetter
            where TMajorGetter : IMajorRecordCommonGetter, IBinaryItem, IDuplicatable
        {
            var ret = (TMajor)source.Duplicate(() => group.SourceMod.GetNextFormKey(edid));

            group.Add(ret);
            return(ret);
        }
Esempio n. 8
0
        public static GameSettingString AddNewShort(this IGroupCommon <GameSetting> gameSettings)
        {
            var ret = new GameSettingString(
                gameSettings.SourceMod.GetNextFormKey(),
                gameSettings.SourceMod.GameRelease.ToSkyrimRelease());

            gameSettings.Add(ret);
            return(ret);
        }
Esempio n. 9
0
        public static GameSettingInt AddNewInt(this IGroupCommon <GameSetting> gameSettings, string editorId)
        {
            var ret = new GameSettingInt(
                gameSettings.SourceMod.GetNextFormKey(editorId),
                gameSettings.SourceMod.GameRelease.ToSkyrimRelease());

            gameSettings.Add(ret);
            return(ret);
        }
Esempio n. 10
0
 /// <summary>
 /// Duplicates a given record (giving it a new FormID) adding it to the group and returning it.
 /// </summary>
 /// <param name="group">Group to add to</param>
 /// <param name="source">Source record to duplicate</param>
 /// <returns>Duplicated and added record</returns>
 public static TMajor DuplicateInAsNewRecord <TMajor, TMajorGetter, TSharedParent>(this IGroupCommon <TMajor> group, TMajorGetter source)
     where TMajor : class, IMajorRecordInternal, TSharedParent
     where TMajorGetter : TSharedParent
     where TSharedParent : IMajorRecordGetter
 {
     try
     {
         var newRec = (source.Duplicate(group.SourceMod.GetNextFormKey()) as TMajor) !;
         group.Add(newRec);
         return(newRec);
     }
     catch (Exception ex)
     {
         throw RecordException.Enrich <TMajor>(ex, source.FormKey, source.EditorID);
     }
 }