23 lines
780 B
C#
23 lines
780 B
C#
using System;
|
|
|
|
namespace ShrinkModFramework
|
|
{
|
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
|
|
public sealed class ShrinkModDependencyAttribute : Attribute
|
|
{
|
|
public string ModId { get; }
|
|
public string MinimumVersion { get; }
|
|
public bool Optional { get; }
|
|
|
|
public ShrinkModDependencyAttribute(string modId, string minimumVersion = null, bool optional = false)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(modId))
|
|
throw new ArgumentException("依赖模组 ID 不能为空。", nameof(modId));
|
|
|
|
ModId = modId.Trim();
|
|
MinimumVersion = string.IsNullOrWhiteSpace(minimumVersion) ? null : minimumVersion.Trim();
|
|
Optional = optional;
|
|
}
|
|
}
|
|
}
|