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).
Implements
Inherited Members
Namespace: GoRogue.MapGeneration.TunnelCreators
Assembly: GoRogue.dll
Syntax
public class HorizontalVerticalTunnelCreator : ITunnelCreator
Constructors
View SourceHorizontalVerticalTunnelCreator(IEnhancedRandom?)
Creates a new tunnel creator.
Declaration
public HorizontalVerticalTunnelCreator(IEnhancedRandom? rng = null)
Parameters
Type | Name | Description |
---|---|---|
IEnhancedRandom | rng | RNG to use for movement selection. |
Methods
View SourceCreateTunnel(ISettableGridView<bool>, Point, Point)
Implements the algorithm, creating the tunnel between the two points (ensuring there is a path of positions set to true between those two points).
Declaration
public Area CreateTunnel(ISettableGridView<bool> map, Point tunnelStart, Point tunnelEnd)
Parameters
Type | Name | Description |
---|---|---|
ISettableGridView<bool> | map | _grid to create the tunnel on. |
Point | tunnelStart | Start position to connect. |
Point | tunnelEnd | End position to connect. |
Returns
Type | Description |
---|---|
Area | An area containing all points that are part of the tunnel. |
CreateTunnel(ISettableGridView<bool>, int, int, int, int)
Implements the algorithm, creating the tunnel between the two points (ensuring there is a path of positions set to true between those two points).
Declaration
public Area CreateTunnel(ISettableGridView<bool> map, int startX, int startY, int endX, int endY)
Parameters
Type | Name | Description |
---|---|---|
ISettableGridView<bool> | map | _grid to create the tunnel on. |
int | startX | X-value of the start position to connect. |
int | startY | Y-value of the start position to connect. |
int | endX | X-value of the end position to connect. |
int | endY | Y-value of the end position to connect. |
Returns
Type | Description |
---|---|
Area | An area containing all points that are part of the tunnel. |