Struct BisectionResult
Structure representing the result of a rectangle bisection.
Assembly: TheSadRogue.Primitives.dll
Syntax
public readonly struct BisectionResult : IEquatable<BisectionResult>, IMatchable<BisectionResult>, IEnumerable<Rectangle>, IEnumerable
Constructors
View Source
BisectionResult(Rectangle, Rectangle)
Declaration
public BisectionResult(Rectangle rect1, Rectangle rect2)
Parameters
| Type |
Name |
Description |
| Rectangle |
rect1 |
The first rectangle.
|
| Rectangle |
rect2 |
The second rectangle.
|
Fields
View Source
Rect1
Declaration
public readonly Rectangle Rect1
Field Value
View Source
Rect2
Declaration
public readonly Rectangle Rect2
Field Value
Methods
View Source
Deconstruct(out Rectangle, out Rectangle)
Supports C# Deconstruction syntax.
Declaration
public void Deconstruct(out Rectangle rect1, out Rectangle rect2)
Parameters
View Source
Equals(BisectionResult)
True if the given bisection result contains equivalent rectangles; false otherwise.
Declaration
public bool Equals(BisectionResult other)
Parameters
Returns
View Source
Equals(object?)
True if the given object is a BisectionResult and contains equivalent rectangles; false otherwise.
Declaration
public override bool Equals(object? obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
View Source
FromTuple((Rectangle rect1, Rectangle rect2))
Converts the tuple to an equivalent BisectionResult.
Declaration
public static BisectionResult FromTuple((Rectangle rect1, Rectangle rect2) tuple)
Parameters
Returns
View Source
GetEnumerator()
Gets an enumerator that iterates over the rectangles in this result; first Rect1, then Rect2.
Declaration
public BisectionResultEnumerator GetEnumerator()
Returns
| Type |
Description |
| BisectionResultEnumerator |
An enumerator that iterates over the rectangles in this result; first Rect1, then Rect2
|
View Source
GetHashCode()
Returns a hash code based on all of the rectangle's fields.
Declaration
public override int GetHashCode()
Returns
Overrides
View Source
Matches(BisectionResult)
True if the given bisection result contains equivalent rectangles; false otherwise.
Declaration
public bool Matches(BisectionResult other)
Parameters
Returns
View Source
ToEnumerable()
Declaration
[Obsolete("This method is obsolete; this structure itself implements IEnumerable directly and provides equivalent behavior, so you should no longer call this function.")]
public IEnumerable<Rectangle> ToEnumerable()
Returns
View Source
ToTuple()
Converts the pair to an equivalent tuple.
Declaration
public (Rectangle rect1, Rectangle rect2) ToTuple()
Returns
Operators
View Source
operator ==(BisectionResult, BisectionResult)
True if the given results contain equivalent rectangles; false otherwise.
Declaration
public static bool operator ==(BisectionResult left, BisectionResult right)
Parameters
Returns
View Source
implicit operator (Rectangle rect1, Rectangle rect2)(BisectionResult)
Implicit conversion to an equivalent tuple.
Declaration
public static implicit operator (Rectangle rect1, Rectangle rect2)(BisectionResult result)
Parameters
| Type |
Name |
Description |
| BisectionResult |
result |
The BisectionResult to convert to a tuple.
|
Returns
View Source
implicit operator BisectionResult((Rectangle rect1, Rectangle rect2))
Implicit conversion from a tuple to the equivalent bisection result.
Declaration
public static implicit operator BisectionResult((Rectangle rect1, Rectangle rect2) tuple)
Parameters
Returns
View Source
operator !=(BisectionResult, BisectionResult)
True if the given results contain different rectangles; false otherwise.
Declaration
public static bool operator !=(BisectionResult left, BisectionResult right)
Parameters
Returns
Implements
Extension Methods