Skip to content

Commit

Permalink
TimeSpan用のメソッドを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
ebifrier committed Jan 30, 2025
1 parent 6a979d5 commit 08e3da5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Ragnarok/MathEx/MathUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ public static int Between(int a, int b, int v)
return Math.Max(a, Math.Min(v, b));
}

/// <summary>
/// a~bに値が収まるようにvを調整します。
/// </summary>
public static TimeSpan Between(TimeSpan a, TimeSpan b, TimeSpan v)
{
return Max(a, Min(v, b));
}

/// <summary>
/// 内積を計算します。
/// </summary>
Expand Down

0 comments on commit 08e3da5

Please sign in to comment.