@@ -7,13 +7,13 @@ namespace RDMSharp
7
7
{
8
8
internal class RDMDiscoveryContext
9
9
{
10
- private readonly HashSet < RDMUID > _foundUids = new HashSet < RDMUID > ( ) ;
11
- private readonly HashSet < RDMUID > _falseOnUids = new HashSet < RDMUID > ( ) ;
10
+ private readonly HashSet < UID > _foundUids = new HashSet < UID > ( ) ;
11
+ private readonly HashSet < UID > _falseOnUids = new HashSet < UID > ( ) ;
12
12
private readonly ConcurrentDictionary < ulong , RemovedUIDRange > removedRange = new ConcurrentDictionary < ulong , RemovedUIDRange > ( ) ;
13
- private ulong rangeToSearch = ( ulong ) ( RDMUID . Broadcast - 1 ) ;
13
+ private ulong rangeToSearch = ( ulong ) ( UID . Broadcast - 1 ) ;
14
14
private string _statusString ;
15
15
private RDMDiscoveryStatus _status = new RDMDiscoveryStatus ( ) ;
16
- private RDMUID ? lastFoundUid ;
16
+ private UID ? lastFoundUid ;
17
17
private ulong messageCount ;
18
18
19
19
@@ -24,35 +24,35 @@ public RDMDiscoveryContext(IProgress<RDMDiscoveryStatus> progress = null)
24
24
this . _progress = progress ;
25
25
}
26
26
27
- internal bool AlreadyFound ( RDMUID uid ) => _foundUids . Contains ( uid ) ;
27
+ internal bool AlreadyFound ( UID uid ) => _foundUids . Contains ( uid ) ;
28
28
29
- internal void AddFound ( RDMUID uid )
29
+ internal void AddFound ( UID uid )
30
30
{
31
31
_foundUids . Add ( uid ) ;
32
32
lastFoundUid = uid ;
33
33
UpdateReport ( ) ;
34
34
}
35
35
36
- internal void AddFound ( IEnumerable < RDMUID > uid )
36
+ internal void AddFound ( IEnumerable < UID > uid )
37
37
{
38
38
_foundUids . UnionWith ( uid ) ;
39
39
lastFoundUid = uid . LastOrDefault ( ) ;
40
40
UpdateReport ( ) ;
41
41
}
42
- internal void AddFalseOn ( RDMUID uid )
42
+ internal void AddFalseOn ( UID uid )
43
43
{
44
44
_falseOnUids . Add ( uid ) ;
45
45
}
46
- internal bool IsFalseOn ( RDMUID uid )
46
+ internal bool IsFalseOn ( UID uid )
47
47
{
48
48
return _falseOnUids . Contains ( uid ) ;
49
49
}
50
50
51
51
internal int FoundCount => _foundUids . Count ;
52
52
53
- internal IReadOnlyCollection < RDMUID > FoundUIDs => _foundUids . ToList ( ) ;
53
+ internal IReadOnlyCollection < UID > FoundUIDs => _foundUids . ToList ( ) ;
54
54
55
- internal void RemoveRange ( RDMUID uidStart , RDMUID uidEnd )
55
+ internal void RemoveRange ( UID uidStart , UID uidEnd )
56
56
{
57
57
var newRemovedRange = new RemovedUIDRange ( uidStart , uidEnd ) ;
58
58
var overlap = removedRange . FirstOrDefault ( r => areRangesOverlapping ( r . Value . StartUID , r . Value . EndUID , newRemovedRange . StartUID , newRemovedRange . EndUID ) ) ;
@@ -90,10 +90,10 @@ internal void RemoveRange(RDMUID uidStart, RDMUID uidEnd)
90
90
foreach ( var r in removedRange )
91
91
sumDelta += ( ulong ) r . Value . Delta ;
92
92
93
- rangeToSearch = ( ulong ) ( RDMUID . Broadcast - 1 ) - sumDelta ;
93
+ rangeToSearch = ( ulong ) ( UID . Broadcast - 1 ) - sumDelta ;
94
94
UpdateReport ( ) ;
95
95
96
- static bool areRangesOverlapping ( RDMUID start1 , RDMUID end1 , RDMUID start2 , RDMUID end2 )
96
+ static bool areRangesOverlapping ( UID start1 , UID end1 , UID start2 , UID end2 )
97
97
{
98
98
if ( start1 <= end2 && end1 >= start2 ) // Check for overlap
99
99
return true ;
@@ -144,19 +144,19 @@ private RDMDiscoveryStatus GetStatus()
144
144
}
145
145
internal class RemovedUIDRange
146
146
{
147
- public readonly RDMUID StartUID ;
148
- public readonly RDMUID EndUID ;
149
- public readonly RDMUID Delta ;
147
+ public readonly UID StartUID ;
148
+ public readonly UID EndUID ;
149
+ public readonly UID Delta ;
150
150
151
- public RemovedUIDRange ( in RDMUID startUID , in RDMUID endUID )
151
+ public RemovedUIDRange ( in UID startUID , in UID endUID )
152
152
{
153
153
StartUID = startUID ;
154
154
EndUID = endUID ;
155
155
Delta = EndUID - StartUID ;
156
156
}
157
157
public static RemovedUIDRange Merge ( RemovedUIDRange one , RemovedUIDRange other )
158
158
{
159
- return new RemovedUIDRange ( new RDMUID ( Math . Min ( ( ulong ) one . StartUID , ( ulong ) other . StartUID ) ) , new RDMUID ( Math . Max ( ( ulong ) one . EndUID , ( ulong ) other . EndUID ) ) ) ;
159
+ return new RemovedUIDRange ( new UID ( Math . Min ( ( ulong ) one . StartUID , ( ulong ) other . StartUID ) ) , new UID ( Math . Max ( ( ulong ) one . EndUID , ( ulong ) other . EndUID ) ) ) ;
160
160
}
161
161
public override string ToString ( )
162
162
{
0 commit comments