Show / Hide Table of Contents

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
System.Object
DirectLineTunnelCreator
Implements
ITunnelCreator
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.MapGeneration.Connectors
Assembly: GoRogue.dll
Syntax
public class DirectLineTunnelCreator : ITunnelCreator

Constructors

| Improve this Doc View Source

DirectLineTunnelCreator(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 Source

CreateTunnel(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.

| Improve this Doc View Source

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.

Implements

ITunnelCreator

Extension Methods

Utility.Yield<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX