-
Notifications
You must be signed in to change notification settings - Fork 85
/
GetSpeedLimitResult.cs
29 lines (25 loc) · 1.22 KB
/
GetSpeedLimitResult.cs
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
namespace TrafficManager.State {
using TrafficManager.API.Traffic.Data;
public struct GetSpeedLimitResult {
/// <summary>Valid only if override exists.</summary>
public SpeedValue? OverrideValue;
/// <summary>Contains known default speed limit, or null.</summary>
public SpeedValue? DefaultValue;
/// <summary>
/// Initializes a new instance of the <see cref="GetSpeedLimitResult"/> struct
/// from maybe an override value (nullable SpeedValue) and a
/// default speedlimit value for that lane type.
/// </summary>
/// <param name="overrideValue">Speed limit override value, if exists.</param>
/// <param name="defaultValue">Default speed value if known.</param>
public GetSpeedLimitResult(SpeedValue? overrideValue, SpeedValue? defaultValue) {
this.OverrideValue = overrideValue;
this.DefaultValue = defaultValue;
}
public override string ToString() {
string ov = this.OverrideValue.HasValue ? $"Speed: {this.OverrideValue};" : "NULL";
string dv = this.DefaultValue.HasValue ? $"Default: {this.DefaultValue}" : "NULL";
return $"({ov} {dv})";
}
}
}