Wiki
Clone wikiRogueSharp / RogueSharp / Map / GetCellsAlongLine
MapGetCellsAlongLine Method
Get an IEnumerable of Cells in a line from the Origin Cell to the Destination Cell The resulting IEnumerable includes the Origin and Destination Cells Uses Bresenham's line algorithm to determine which Cells are in the closest approximation to a straight line between the two Cells
Namespace: RogueSharp
Assembly:
Syntax
public IEnumerable<Cell> GetCellsAlongLine( int xOrigin, int yOrigin, int xDestination, int yDestination )
Parameters
xOrigin
Type: SystemInt32
X location of the Origin Cell at the start of the line with 0 as the farthest left
yOrigin
Type: SystemInt32
Y location of the Origin Cell at the start of the line with 0 as the top
xDestination
Type: SystemInt32
X location of the Destination Cell at the end of the line with 0 as the farthest left
yDestination
Type: SystemInt32
Y location of the Destination Cell at the end of the line with 0 as the top
Return Value
Type: IEnumerableCell
IEnumerable of Cells in a line from the Origin Cell to the Destination Cell which includes the Origin and Destination Cells
Implements
IMapGetCellsAlongLine(Int32, Int32, Int32, Int32)
See Also
Reference
Map Class
RogueSharp Namespace
[5]: 2014-2016 Faron Bracy
Updated