Interface IReadOnlyDisjointSet<T>
Read-only representation of DisjointSet<T>.
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public interface IReadOnlyDisjointSet<T>
Type Parameters
Name | Description |
---|---|
T |
Properties
View SourceCount
Number of distinct sets.
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
int |
Methods
View SourceFind(T)
Returns the parent of the set containing item
, performing path compression as search is
completed.
Declaration
T Find(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | Object to search for. |
Returns
Type | Description |
---|---|
T | The parent of the object given. |
InSameSet(T, T)
Returns true if the two objects specified are in the same set.
Declaration
bool InSameSet(T item1, T item2)
Parameters
Type | Name | Description |
---|---|---|
T | item1 | |
T | item2 |
Returns
Type | Description |
---|---|
bool | True if the two objects are in the same set, false otherwise. |
Events
View SourceSetsJoined
Fired when two sets are joined into one. The arguments give the two sets that were joined.
Declaration
event EventHandler<JoinedEventArgs<T>>? SetsJoined
Event Type
Type | Description |
---|---|
EventHandler<JoinedEventArgs<T>> |