Class HorizontalVerticalTunnelCreator
Implements a tunnel creation algorithm that creates a tunnel that performs all needed vertical movement before horizontal movement, or vice versa (depending on rng).
Inheritance
Implements
Inherited Members
Namespace: GoRogue.MapGeneration.Connectors
Assembly: GoRogue.dll
Syntax
public class HorizontalVerticalTunnelCreator : ITunnelCreator
Constructors
| Improve this Doc View SourceHorizontalVerticalTunnelCreator(IGenerator)
Constructor. Takes rng to use -- if null is specified, the DefaultRNG is used.
Declaration
public HorizontalVerticalTunnelCreator(IGenerator rng = null)
Parameters
Type | Name | Description |
---|---|---|
Troschuetz.Random.IGenerator | rng | Rng to use -- if null is specified, DefaultRNG is used. |
Methods
| Improve this Doc View SourceCreateTunnel(ISettableMapView<Boolean>, Coord, Coord)
Implemnets 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. |