Show / Hide Table of Contents

Struct EllipsePositionsEnumerator

A custom enumerator used to iterate over all positions on the outside of an ellipse efficiently.

Generally, you should use GetEllipse(Point, Point) to get an instance of this, rather than creating one yourself.

Implements
IEnumerator<Point>
IEnumerator
IDisposable
IEnumerable<Point>
IEnumerable
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
public struct EllipsePositionsEnumerator : IEnumerator<Point>, IEnumerator, IDisposable, IEnumerable<Point>, IEnumerable
Remarks

This type is a struct, and as such is much more efficient when used in a foreach loop than a function returning IEnumerable<Point> by using "yield return". This type does implement IEnumerable<T>, so you can pass it to functions which require one (for example, System.LINQ). However, this will have reduced performance due to boxing of the iterator.

Constructors

View Source

EllipsePositionsEnumerator(Point, Point)

Creates an enumerator which iterates over all positions on the outside of the given ellipse.

Declaration
public EllipsePositionsEnumerator(Point f1, Point f2)
Parameters
Type Name Description
Point f1

The first focus point of the ellipse.

Point f2

The second focus point of the ellipse.

Properties

View Source

Current

The current value for enumeration.

Declaration
public Point Current { get; }
Property Value
Type Description
Point

Methods

View Source

GetEnumerator()

Returns this enumerator.

Declaration
public EllipsePositionsEnumerator GetEnumerator()
Returns
Type Description
EllipsePositionsEnumerator

This enumerator.

View Source

MoveNext()

Advances the iterator to the next position.

Declaration
public bool MoveNext()
Returns
Type Description
bool

True if the a new position on the outside of the ellipse exists; false otherwise.

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<Point> ToEnumerable()
Returns
Type Description
IEnumerable<Point>

Implements

IEnumerator<T>
IEnumerator
IDisposable
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