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

Public Member Functions

 TilePositionsProvider (CoordinateWrapper coordinateWrapper, Dictionary< Vector3Int, int > TileIndexByPosition)
 
List< Vector3Int > AdjcacentToCorner (Vector3Int corner)
 returns the map tiles adjacent to the input corner More...
 
List< Vector3Int > AdjacentToEdge (Vector3Int edge)
 returns the map tiles adjacent to the input edge More...
 
List< Vector3Int > AdjacentToTile (Vector3Int center)
 returns the map tiles directly neigbouring the input tile More...
 
List< Vector3Int > Cone (Vector3Int origin, Vector3Int targetDirection, float coneHalfAngle, int coneLength)
 returns all map tiles of a cone starting at a point with given direction, length and width More...
 
List< Vector3Int > Ring (Vector3Int center, int radius, int thicknessInwards)
 returns all map tiles of a ring around center in no defined order More...
 
List< Vector3Int > Ring (Vector3Int center, int radius, TileDirection startDirection, bool clockwise)
 returns all map tiles of a ring around center in order specified by parameters (startDirection, clockwise) More...
 
List< Vector3Int > Line (Vector3Int origin, Vector3Int target, bool includeOrigin, float horizontalNudgeFromOriginCenter=NudgePositive)
 returns tiles forming a line between origin and target tile, optionally including the origin tile itself More...
 
List< Vector3Int > Disc (Vector3Int center, int range, bool includeCenter)
 Returns all tiles of the map which are within distance of the center point, either with or without the center point More...
 
List< List< Vector3Int > > ContiguousAreasOfInputTiles (ICollection< Vector3Int > inputTiles)
 splits the input collection into separated Lists for each contiguous area formed by the input tile coordinates. More...
 

Protected Member Functions

List< Vector3Int > GetValidTileCoordinates (List< Vector3Int > rawPositions)
 Returns the subset of coordinates of the input which are a valid part of the map, accounting for map wrap around. More...
 

Protected Attributes

readonly CoordinateWrapper coordinateWrapper
 
readonly Dictionary< Vector3Int, int > TileIndexByPosition
 

Member Function Documentation

◆ AdjcacentToCorner()

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.AdjcacentToCorner ( Vector3Int  corner)

returns the map tiles adjacent to the input corner

Map_GetTiles_AdjacentToCorner_Combined.png
blue = input corner , green = result

◆ AdjacentToEdge()

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.AdjacentToEdge ( Vector3Int  edge)

returns the map tiles adjacent to the input edge

Map_GetTiles_AdjacentToEdge_Combined.png
blue = input edge , green = result

◆ AdjacentToTile()

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.AdjacentToTile ( Vector3Int  center)

returns the map tiles directly neigbouring the input tile

Map_GetTiles_AdjacentToTile_Combined.png
yellow = input tile , green = result

◆ Cone()

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.Cone ( Vector3Int  origin,
Vector3Int  targetDirection,
float  coneHalfAngle,
int  coneLength 
)

returns all map tiles of a cone starting at a point with given direction, length and width

Map_GetTiles_Cone_Combined.png
yellow = origin , blue = direction, green = result

◆ Ring() [1/2]

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.Ring ( Vector3Int  center,
int  radius,
int  thicknessInwards 
)

returns all map tiles of a ring around center in no defined order

Map_GetTiles_Ring_Combined.png
yellow = origin , green = ring tiles

◆ Ring() [2/2]

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.Ring ( Vector3Int  center,
int  radius,
TileDirection  startDirection,
bool  clockwise 
)

returns all map tiles of a ring around center in order specified by parameters (startDirection, clockwise)

◆ Line()

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.Line ( Vector3Int  origin,
Vector3Int  target,
bool  includeOrigin,
float  horizontalNudgeFromOriginCenter = NudgePositive 
)

returns tiles forming a line between origin and target tile, optionally including the origin tile itself

Map_GetTiles_Lines_Combined.png
yellow = origin , blue = target, yellow/blue = line, when includeOrigin = true the origin belongs is part of the line

◆ Disc()

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.Disc ( Vector3Int  center,
int  range,
bool  includeCenter 
)

Returns all tiles of the map which are within distance of the center point, either with or without the center point

Map_GetTiles_Disc_Combined.png
yellow = input , green = result

◆ ContiguousAreasOfInputTiles()

List<List<Vector3Int> > Wunderwunsch.HexMapLibrary.TilePositionsProvider.ContiguousAreasOfInputTiles ( ICollection< Vector3Int >  inputTiles)

splits the input collection into separated Lists for each contiguous area formed by the input tile coordinates.

Map_GetTiles_ContiguousCombined.png
left = input tile list , right = output separated into different areas

◆ GetValidTileCoordinates()

List<Vector3Int> Wunderwunsch.HexMapLibrary.TilePositionsProvider.GetValidTileCoordinates ( List< Vector3Int >  rawPositions)
protected

Returns the subset of coordinates of the input which are a valid part of the map, accounting for map wrap around.