/// <inheritdoc /> public TMajor AddNew() { var ret = MajorRecordInstantiator <TMajor> .Activator(SourceMod.GetNextFormKey(), _release); InternalCache.Set(ret); return(ret); }
/// <inheritdoc /> public TMajor AddNew(FormKey formKey) { var ret = MajorRecordInstantiator <TMajor> .Activator(formKey, _release); InternalCache.Set(ret); return(ret); }
/// <inheritdoc /> public TMajor AddNew(string editorID) { var ret = MajorRecordInstantiator <TMajor> .Activator(SourceMod.GetNextFormKey(editorID), _release); ret.EditorID = editorID; InternalCache.Set(ret); return(ret); }
public void Direct() { WarmupOblivion.Init(); var form = new FormKey(Mutagen.Bethesda.Oblivion.Constants.Oblivion, 0x123456); var ret = MajorRecordInstantiator <Oblivion.Ammunition> .Activator(form, GameRelease.Oblivion); Assert.IsType <Oblivion.Ammunition>(ret); Assert.Equal(form, ret.FormKey); }
/// <summary> /// Convenience function to instantiate a new Major Record and add it to the Group.<br /> /// FormKey will be automatically assigned. /// </summary> /// <param name="group">Group to add a record to</param> /// <returns>New record already added to the Group</returns> public static TMajor AddNew <TMajor>(this IGroupCommon <TMajor> group) where TMajor : IMajorRecordInternal { var ret = MajorRecordInstantiator <TMajor> .Activator( group.SourceMod.GetNextFormKey(), group.SourceMod.GameRelease); group.Set(ret); return(ret); }
/// <summary> /// Convenience function to instantiate a new Major Record and add it to the Group<br /> /// </summary> /// <param name="group">Group to add a record to</param> /// <param name="formKey">FormKey assign the new record.</param> /// <returns>New record already added to the Group</returns> public static TMajor AddNew <TMajor>(this IGroup <TMajor> group, FormKey formKey) where TMajor : IMajorRecordInternal { var ret = MajorRecordInstantiator <TMajor> .Activator( formKey, group.SourceMod.GameRelease); group.Set(ret); return(ret); }
/// <summary> /// Convenience function to instantiate a new Major Record and add it to the Group.<br /> /// FormKey will be automatically assigned based on the editorID given /// </summary> /// <param name="group">Group to add a record to</param> /// <param name="editorID">Editor ID to assign the new record, and use in any FormKey persistence logic.</param> /// <returns>New record already added to the Group</returns> public static TMajor AddNew <TMajor>(this IGroup <TMajor> group, string?editorID) where TMajor : IMajorRecordInternal { var ret = MajorRecordInstantiator <TMajor> .Activator( group.SourceMod.GetNextFormKey(editorID), group.SourceMod.GameRelease); ret.EditorID = editorID; group.Set(ret); return(ret); }