Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
IntRange.cs
Go to the documentation of this file.
1using Newtonsoft.Json;
2
3namespace Terraria.Utilities;
4
5public struct IntRange
6{
7 [JsonProperty("Min")]
8 public readonly int Minimum;
9
10 [JsonProperty("Max")]
11 public readonly int Maximum;
12
13 public IntRange(int minimum, int maximum)
14 {
15 Minimum = minimum;
16 Maximum = maximum;
17 }
18
19 public static IntRange operator *(IntRange range, float scale)
20 {
21 return new IntRange((int)((float)range.Minimum * scale), (int)((float)range.Maximum * scale));
22 }
23
24 public static IntRange operator *(float scale, IntRange range)
25 {
26 return range * scale;
27 }
28
29 public static IntRange operator /(IntRange range, float scale)
30 {
31 return new IntRange((int)((float)range.Minimum / scale), (int)((float)range.Maximum / scale));
32 }
33
34 public static IntRange operator /(float scale, IntRange range)
35 {
36 return range / scale;
37 }
38}
static IntRange operator*(IntRange range, float scale)
Definition IntRange.cs:19
static IntRange operator/(IntRange range, float scale)
Definition IntRange.cs:29
IntRange(int minimum, int maximum)
Definition IntRange.cs:13