Class DirectLineTunnelCreator
Implements a tunnel creation algorithm that sets as walkable a direct line between the two points. In the case that MANHATTAN is being used, the line is calculated via the ORTHO algorithm. Otherwise, the line is calculated using BRESENHAM.
Inheritance
Implements
Inherited Members
Namespace: GoRogue.MapGeneration.Connectors
Assembly: GoRogue.dll
Syntax
public class DirectLineTunnelCreator : ITunnelCreator
Constructors
| Improve this Doc View SourceDirectLineTunnelCreator(AdjacencyRule, Boolean)
Constructor. Takes the distance calculation to use, which determines whether ORTHO or BRESENHAM is used to create the tunnel.
Declaration
public DirectLineTunnelCreator(AdjacencyRule adjacencyRule, bool doubleWideVertical = true)
Parameters
Type | Name | Description |
---|---|---|
AdjacencyRule | adjacencyRule | Method of adjacency to respect when creating tunnels. Cannot be diagonal. |
System.Boolean | doubleWideVertical | Whether or not to create vertical tunnels as 2-wide. |
Methods
| Improve this Doc View SourceCreateTunnel(ISettableMapView<Boolean>, Coord, Coord)
Implements the algorithm, creating the tunnel as specified in the class description.
Declaration
public void CreateTunnel(ISettableMapView<bool> map, Coord start, Coord end)
Parameters
Type | Name | Description |
---|---|---|
ISettableMapView<System.Boolean> | map | The map to create the tunnel on. |
Coord | start | Start coordinate of the tunnel. |
Coord | end | End coordinate of the tunnel. |
CreateTunnel(ISettableMapView<Boolean>, Int32, Int32, Int32, Int32)
Implements the algorithm, creating the tunnel as specified in the class description.
Declaration
public void CreateTunnel(ISettableMapView<bool> map, int startX, int startY, int endX, int endY)
Parameters
Type | Name | Description |
---|---|---|
ISettableMapView<System.Boolean> | map | The map to create the tunnel on. |
System.Int32 | startX | X-value of the start position of the tunnel. |
System.Int32 | startY | Y-value of the start position of the tunnel. |
System.Int32 | endX | X-value of the end position of the tunnel. |
System.Int32 | endY | Y-value of the end position of the tunnel. |