This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
namespace ShrinkModFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// 延迟模组组件源。Revision 是来源内容的稳定指纹(外部 DLL 可使用文件哈希);
|
||||
/// 同一 ModId 的 revision/factory 变化由 ShrinkModContextHost 作为替换事务处理。
|
||||
/// </summary>
|
||||
public sealed class ShrinkModComponentSource
|
||||
{
|
||||
public ShrinkModComponentSource(ShrinkModInfo info, string revision, Func<IShrinkMod> factory)
|
||||
{
|
||||
Info = info ?? throw new ArgumentNullException(nameof(info));
|
||||
if (string.IsNullOrWhiteSpace(info.ModId))
|
||||
throw new ArgumentException("ModId must not be empty.", nameof(info));
|
||||
if (string.IsNullOrWhiteSpace(revision))
|
||||
throw new ArgumentException("Revision must not be empty.", nameof(revision));
|
||||
|
||||
Revision = revision.Trim();
|
||||
Factory = factory ?? throw new ArgumentNullException(nameof(factory));
|
||||
}
|
||||
|
||||
public ShrinkModInfo Info { get; }
|
||||
public string Revision { get; }
|
||||
public Func<IShrinkMod> Factory { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user