protected void DisposeFormKeyAllocator(IFormKeyAllocator allocator) { if (allocator is IDisposable disposable) { disposable.Dispose(); } }
protected AMod() { this.ModKey = ModKey.Null; this._allocator = new SimpleFormKeyAllocator(this); }
/// <summary> /// Constructor /// </summary> /// <param name="modKey">Key to assign the mod</param> public AMod(ModKey modKey) { this.ModKey = modKey; this._allocator = new SimpleFormKeyAllocator(this); }
/// <summary> /// Constructor /// </summary> /// <param name="modKey">Key to assign the mod</param> /// <param name="allocator">Optional custom FormKey allocator logic</param> public AMod(ModKey modKey, IFormKeyAllocator?allocator = null) { this.ModKey = modKey; this._allocator = allocator ?? new SimpleFormKeyAllocator(this); }