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