Class Lines
Provides implementations of various (line-drawing) algorithms which are useful for for generating points closest to a line between two points on a grid.
Inheritance
Inherited Members
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public static class Lines
Methods
| Improve this Doc View SourceGet(Coord, Coord, Lines.Algorithm)
Returns an IEnumerable of every point, in order, closest to a line between the two points specified, using the line drawing algorithm given. The start and end points will be included.
Declaration
public static IEnumerable<Coord> Get(Coord start, Coord end, Lines.Algorithm type = Lines.Algorithm.BRESENHAM)
Parameters
Type | Name | Description |
---|---|---|
Coord | start | The start point of the line. |
Coord | end | The end point of the line. |
Lines.Algorithm | type | The line-drawing algorithm to use to generate the line. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Coord> | An IEnumerable of every point, in order, closest to a line between the two points specified (according to the algorithm given). |
Get(Int32, Int32, Int32, Int32, Lines.Algorithm)
Returns an IEnumerable of every point, in order, closest to a line between the two points specified, using the line drawing algorithm given. The start and end points will be included.
Declaration
public static IEnumerable<Coord> Get(int startX, int startY, int endX, int endY, Lines.Algorithm type = Lines.Algorithm.BRESENHAM)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startX | X-coordinate of the starting point of the line. |
System.Int32 | startY | Y-coordinate of the starting point of the line. |
System.Int32 | endX | X-coordinate of the ending point of the line. |
System.Int32 | endY | Y-coordinate of the ending point of the line. |
Lines.Algorithm | type | The line-drawing algorithm to use to generate the line. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Coord> | An IEnumerable of every point, in order, closest to a line between the two points specified (according to the algorithm given). |