Class RadiusLocationContext
A context representing information necessary to get all the positions in a radius via functions like PositionsInRadius(RadiusLocationContext). Storing a context and re-using it may be more performant in cases where you're getting the positions in a radius of the same size many times, even if the location center point or shape of the radius is changing.
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
public class RadiusLocationContext : Object
Constructors
RadiusLocationContext(Point, Int32)
Constructor.
Declaration
public RadiusLocationContext(Point center, int radius)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | center | The starting center-point of the radius. |
| Int32 | radius | The starting length of the radius. |
RadiusLocationContext(Point, Int32, Rectangle)
Constructor.
Declaration
public RadiusLocationContext(Point center, int radius, Rectangle bounds)
Parameters
| Type | Name | Description |
|---|---|---|
| Point | center | The starting center-point of the radius. |
| Int32 | radius | The starting length of the radius. |
| Rectangle | bounds | The bounds to restrict the radius to. Any positions inside the radius but outside the bounds will be ignored and considered outside the radius. |
RadiusLocationContext(Int32, Int32, Int32)
Constructor.
Declaration
public RadiusLocationContext(int centerX, int centerY, int radius)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | centerX | X-value of the starting center-point of the radius. |
| Int32 | centerY | Y-value of the starting center-point of the radius. |
| Int32 | radius | The starting length of the radius. |
RadiusLocationContext(Int32, Int32, Int32, Rectangle)
Constructor.
Declaration
public RadiusLocationContext(int centerX, int centerY, int radius, Rectangle bounds)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | centerX | X-value of the starting center-point of the radius. |
| Int32 | centerY | Y-value of the starting center-point of the radius. |
| Int32 | radius | The starting length of the radius. |
| Rectangle | bounds | The bounds to restrict the radius to. Any positions inside the radius but outside the bounds will be ignored and considered outside the radius. |
Fields
Bounds
Represents the bounds that restrict the valid positions that are considered inside the radius. Any positions inside the radius but outside the bounds will be ignored and considered outside the radius.Set to Empty to indicate no bounds.
Declaration
public Rectangle Bounds
Field Value
| Type | Description |
|---|---|
| Rectangle |
Properties
Center
The center-point of the radius represented.
Declaration
public Point Center { get; set; }
Property Value
| Type | Description |
|---|---|
| Point |
Radius
The length of the radius represented.
Declaration
public int Radius { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |