HexMapLibrary
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Wunderwunsch.HexMapLibrary.EdgePositionsProvider Class Reference

Public Member Functions

 EdgePositionsProvider (CoordinateWrapper coordinateWrapper, Dictionary< Vector3Int, int > EdgeIndexByPosition)
 
List< Vector3Int > OfTile (Vector3Int tile)
 returns all edges of the input tile More...
 
List< Vector3Int > AdjacentToCorner (Vector3Int corner)
 returns all edges adjacent to the input corner which belong to the map More...
 
List< Vector3Int > AdjacentEdges (Vector3Int edge)
 returns all edges adjacent to the input edge which belong to the map More...
 
List< Vector3Int > WithinDistanceOfEdge (Vector3Int centerEdge, int maxDistance, bool includeSelf)
 returns all edges within range of the input edge which belong to the map More...
 
List< Vector3Int > WithinDistanceOfCorner (Vector3Int corner, int maxDistance)
 returns all edges within range of the input corner which belong to the map More...
 
List< Vector3Int > AtExactDistance (Vector3Int centerEdge, int distance)
 returns all edges at the exact distance of the input edge which belong to the map More...
 
List< Vector3Int > TileBorders (IEnumerable< Vector3Int > tiles)
 returns a list of all edges which form the border(s) of the input Tile Coordinates. They are returned in an arbitrary order and might belong to different border paths. More...
 
List< Vector3Int > TileBorders (IEnumerable< Tile > tiles)
 returns a list of all edges which form the border(s) of the input Tile Coordinates. They are returned in an arbitrary order and might belong to different border paths. More...
 
List< Vector3Int > PathBetweenCorners (Vector3Int originCorner, Vector3Int targetCorner, float horizontalNudgeFromOriginCenter=NudgePositive)
 returns the shortest path of edges from origin to target corner More...
 
List< List< Vector3Int > > BorderPaths (IEnumerable< Vector3Int > tiles, out List< List< EdgeDirection >> pathDirections)
 returns an list of each contiguous border path of the input Tile Coordinates. Each individual path is ordered in clockwise direction with an arbitrary starting point. The different Paths are returned in an arbitrary order
More...
 

Protected Member Functions

List< Vector3Int > GetValidEdgeCoordinates (List< Vector3Int > rawPositions)
 wraps edge coordinates and then removes all which are out of map bounds More...
 

Protected Attributes

readonly CoordinateWrapper coordinateWrapper
 
readonly Dictionary< Vector3Int, int > EdgeIndexByPosition
 

Member Function Documentation

◆ OfTile()

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.OfTile ( Vector3Int  tile)

returns all edges of the input tile

GetEdges_OfTile.png
yellow = input tile , blue = result

◆ AdjacentToCorner()

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.AdjacentToCorner ( Vector3Int  corner)

returns all edges adjacent to the input corner which belong to the map

Map_GetEdges_AdjacentToCorner_Combined.png
green = input corner , blue = result

◆ AdjacentEdges()

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.AdjacentEdges ( Vector3Int  edge)

returns all edges adjacent to the input edge which belong to the map

Map_GetEdges_AdjacentToEdge_Combined.png
green = input edge , blue = result

◆ WithinDistanceOfEdge()

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.WithinDistanceOfEdge ( Vector3Int  centerEdge,
int  maxDistance,
bool  includeSelf 
)

returns all edges within range of the input edge which belong to the map

green = input edge, blue = result

◆ WithinDistanceOfCorner()

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.WithinDistanceOfCorner ( Vector3Int  corner,
int  maxDistance 
)

returns all edges within range of the input corner which belong to the map

Map_GetEdges_WithinDistanceOfCorner_Combined.png
green = input corner , blue = result

◆ AtExactDistance()

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.AtExactDistance ( Vector3Int  centerEdge,
int  distance 
)

returns all edges at the exact distance of the input edge which belong to the map

Map_GetEdges_AtExactDistance_Combined.png
green = input corner , blue = result

◆ TileBorders() [1/2]

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.TileBorders ( IEnumerable< Vector3Int >  tiles)

returns a list of all edges which form the border(s) of the input Tile Coordinates. They are returned in an arbitrary order and might belong to different border paths.

Map_GetEdges_TileBorders.png
green = input tiles , blue = result

◆ TileBorders() [2/2]

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.TileBorders ( IEnumerable< Tile tiles)

returns a list of all edges which form the border(s) of the input Tile Coordinates. They are returned in an arbitrary order and might belong to different border paths.

◆ PathBetweenCorners()

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.PathBetweenCorners ( Vector3Int  originCorner,
Vector3Int  targetCorner,
float  horizontalNudgeFromOriginCenter = NudgePositive 
)

returns the shortest path of edges from origin to target corner

Map_GetEdges_PathBetweenCorners_Combined.png
green = origin corner , purple = target corner, blue = result

◆ BorderPaths()

List<List<Vector3Int> > Wunderwunsch.HexMapLibrary.EdgePositionsProvider.BorderPaths ( IEnumerable< Vector3Int >  tiles,
out List< List< EdgeDirection >>  pathDirections 
)

returns an list of each contiguous border path of the input Tile Coordinates. Each individual path is ordered in clockwise direction with an arbitrary starting point. The different Paths are returned in an arbitrary order

Map_GetEdges_BorderPaths.png
green = input tiles , blue = result

◆ GetValidEdgeCoordinates()

List<Vector3Int> Wunderwunsch.HexMapLibrary.EdgePositionsProvider.GetValidEdgeCoordinates ( List< Vector3Int >  rawPositions)
protected

wraps edge coordinates and then removes all which are out of map bounds