-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUtils.cs
More file actions
42 lines (38 loc) · 784 Bytes
/
Utils.cs
File metadata and controls
42 lines (38 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace LiveSplit.RedFaction
{
internal static class Utils
{
public static int Clamp(int value, int min, int max)
{
if (value > max)
return max;
else if (value < min)
return min;
else
return value;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void WriteDebug(string text)
{
#if DEBUG
Debug.WriteLine(text);
#endif
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void WriteDebug(object obj)
{
#if DEBUG
Debug.WriteLine(obj);
#endif
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void WriteDebugIf(bool condition, string text)
{
#if DEBUG
Debug.WriteLineIf(condition, text);
#endif
}
}
}