Show / Hide Table of Contents

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
System.Object
Lines
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public static class Lines

Methods

| Improve this Doc View Source

Get(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).

| Improve this Doc View Source

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).

  • Improve this Doc
  • View Source
Back to top Generated by DocFX