Show / Hide Table of Contents

Struct BisectionResult

Structure representing the result of a rectangle bisection.

Implements
IEquatable<BisectionResult>
IMatchable<BisectionResult>
IEnumerable<Rectangle>
IEnumerable
Inherited Members
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
public readonly struct BisectionResult : IEquatable<BisectionResult>, IMatchable<BisectionResult>, IEnumerable<Rectangle>, IEnumerable

Constructors

View Source

BisectionResult(Rectangle, Rectangle)

Constructor

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

The first rectangle.

Declaration
public readonly Rectangle Rect1
Field Value
Type Description
Rectangle
View Source

Rect2

The second rectangle.

Declaration
public readonly Rectangle Rect2
Field Value
Type Description
Rectangle

Methods

View Source

Deconstruct(out Rectangle, out Rectangle)

Supports C# Deconstruction syntax.

Declaration
public void Deconstruct(out Rectangle rect1, out Rectangle rect2)
Parameters
Type Name Description
Rectangle rect1
Rectangle rect2
View Source

Equals(BisectionResult)

True if the given bisection result contains equivalent rectangles; false otherwise.

Declaration
public bool Equals(BisectionResult other)
Parameters
Type Name Description
BisectionResult other
Returns
Type Description
bool
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
Type Description
bool
Overrides
ValueType.Equals(object)
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
Type Name Description
(Rectangle rect1, Rectangle rect2) tuple
Returns
Type Description
BisectionResult
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
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

Matches(BisectionResult)

True if the given bisection result contains equivalent rectangles; false otherwise.

Declaration
public bool Matches(BisectionResult other)
Parameters
Type Name Description
BisectionResult other
Returns
Type Description
bool
View Source

ToEnumerable()

Obsolete.

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
Type Description
IEnumerable<Rectangle>
View Source

ToTuple()

Converts the pair to an equivalent tuple.

Declaration
public (Rectangle rect1, Rectangle rect2) ToTuple()
Returns
Type Description
(Rectangle rect1, Rectangle rect2)

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
Type Name Description
BisectionResult left
BisectionResult right
Returns
Type Description
bool
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
Type Description
(Rectangle rect1, Rectangle rect2)
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
Type Name Description
(Rectangle rect1, Rectangle rect2) tuple

The tuple to convert to a BisectionResult.

Returns
Type Description
BisectionResult
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
Type Name Description
BisectionResult left
BisectionResult right
Returns
Type Description
bool

Implements

IEquatable<T>
IMatchable<T>
IEnumerable<T>
IEnumerable

Extension Methods

PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?)
PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?, EventHandler<ValueChangedEventArgs<TProperty>>?)
ToStringExtensions.ExtendToString<T>(IEnumerable<T>, string, Func<T, string>?, string, string)
  • View Source
In this article
Back to top Generated by DocFX