浏览代码

Make ValueRange classes inheritable

ManlyMarco 5 年之前
父节点
当前提交
930c6afd8f
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 2 2
      BepInEx/Configuration/AcceptableValueList.cs
  2. 3 3
      BepInEx/Configuration/AcceptableValueRange.cs

+ 2 - 2
BepInEx/Configuration/AcceptableValueList.cs

@@ -6,12 +6,12 @@ namespace BepInEx.Configuration
 	/// <summary>
 	/// Specify the list of acceptable values for a setting.
 	/// </summary>
-	public sealed class AcceptableValueList<T> : AcceptableValueBase where T : IEquatable<T>
+	public class AcceptableValueList<T> : AcceptableValueBase where T : IEquatable<T>
 	{
 		/// <summary>
 		/// List of values that a setting can take.
 		/// </summary>
-		public T[] AcceptableValues { get; }
+		public virtual T[] AcceptableValues { get; }
 
 		/// <summary>
 		/// Specify the list of acceptable values for a setting.

+ 3 - 3
BepInEx/Configuration/AcceptableValueRange.cs

@@ -5,7 +5,7 @@ namespace BepInEx.Configuration
 	/// <summary>
 	/// Specify the range of acceptable values for a setting.
 	/// </summary>
-	public sealed class AcceptableValueRange<T> : AcceptableValueBase where T : IComparable
+	public class AcceptableValueRange<T> : AcceptableValueBase where T : IComparable
 	{
 		/// <param name="minValue">Lowest acceptable value</param>
 		/// <param name="maxValue">Highest acceptable value</param>
@@ -25,12 +25,12 @@ namespace BepInEx.Configuration
 		/// <summary>
 		/// Lowest acceptable value
 		/// </summary>
-		public T MinValue { get; }
+		public virtual T MinValue { get; }
 
 		/// <summary>
 		/// Highest acceptable value
 		/// </summary>
-		public T MaxValue { get; }
+		public virtual T MaxValue { get; }
 
 		/// <inheritdoc />
 		public override object Clamp(object value)