Interface IReadOnlyRadiusAreaProvider
Read-only interface of RadiusAreaProvider.
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public interface IReadOnlyRadiusAreaProvider
Properties
| Improve this Doc View SourceBounds
The bounds to constrain the returned locations to. Set to EMPTY to indicate that there are no bounds.
Declaration
Rectangle Bounds { get; }
Property Value
Type | Description |
---|---|
Rectangle |
Center
The center point of the radius.
Declaration
Coord Center { get; }
Property Value
Type | Description |
---|---|
Coord |
DistanceCalc
The distance calculation used to determine what shape the radius has (or a type implicitly convertible to a distance method, eg. Radius).
Declaration
Distance DistanceCalc { get; }
Property Value
Type | Description |
---|---|
Distance |
Radius
The length of the radius, eg. the number of tiles from the center point (as defined by the distance calculation/radius shape given) to which the radius extends.
Declaration
int Radius { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
When this value is changed, reallocation of an underlying array is performed, however overhead should be relatively small in most cases.
Methods
| Improve this Doc View SourceCalculatePositions()
Calculates the new radius, and returns an IEnumerable of all unique locations within that radius and bounds specified (as applicable).
Declaration
IEnumerable<Coord> CalculatePositions()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Coord> | Enumerable of all unique positions within the radius and bounds specified. |
Remarks
In the case that MANHATTAN/CHEBYSHEV distance, or DIAMOND/SQUARE/OCTAHEDRON/CUBE radius shapes are specified via DistanceCalc, positions returned are guaranteed to be returned in order of distance from the center, from least to greatest. This guarantee does NOT hold if EUCLIDEAN distance, or CIRCLE/SPHERE radius shapes are specified.