HexMapLibrary
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T > Class Template Reference

Public Member Functions

 TilesDataProvider (Dictionary< Vector3Int, Tile< T >> tilesByPosition, TilePositionsProvider tilesPositionsProvider)
 
List< Tile< T > > AdjacentToTile (Tile tile)
 returns the map tiles adjacent to the input tile More...
 
List< Tile< T > > AdjacentToTile (Vector3Int tilePosition)
 returns the map tiles adjacent to the input tile More...
 
List< Tile< T > > AdjacentToEdge (Vector3Int edge)
 returns the map tiles adjacent to the input edge More...
 
List< Tile< T > > AdjacentToEdge (Edge edge)
 returns the map tiles adjacent to the input edge More...
 
List< Tile< T > > AdjacentToCorner (Vector3Int corner)
 returns the map tiles adjacent to the input corner More...
 
List< Tile< T > > AdjacentToCorner (Corner corner)
 returns the map tiles adjacent to the input corner More...
 
List< Tile< T > > Cone (Tile 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< Tile< T > > 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< Tile< T > > Line (Tile 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< Tile< T > > 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< Tile< T > > Ring (Tile center, int radius, int thicknessInwards)
 returns all map tiles of a ring around center in no defined order More...
 
List< Tile< T > > Ring (Vector3Int center, int radius, int thicknessInwards)
 returns all map tiles of a ring around center in no defined order More...
 
List< Tile< T > > Ring (Tile 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< Tile< T > > 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< Tile< T > > Disc (Tile 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< Tile< T > > 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< Tile< T > > > ContiguousAreasOfInputTiles (ICollection< Tile > inputTiles)
 splits the input collection into 1 List for each contiguous area formed by the input tiles More...
 
List< List< Tile< T > > > ContiguousAreasOfInputTiles (ICollection< Vector3Int > inputTiles)
 splits the input collection into 1 List for each contiguous area formed by the input tile coordinates. More...
 

Private Member Functions

List< Tile< T > > GetTilesFromCoordinates (ICollection< Vector3Int > coordinates)
 Returns the tiles belonging to the input coordinates More...
 

Private Attributes

Dictionary< Vector3Int, Tile< T > > tilesByPosition
 
TilePositionsProvider tilesPositionsProvider
 

Member Function Documentation

◆ AdjacentToTile() [1/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.AdjacentToTile ( Tile  tile)

returns the map tiles adjacent to the input tile

Map_GetTiles_AdjacentToTile_Combined.png
yellow = input tile , green = result

◆ AdjacentToTile() [2/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.AdjacentToTile ( Vector3Int  tilePosition)

returns the map tiles adjacent to the input tile

◆ AdjacentToEdge() [1/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.AdjacentToEdge ( Vector3Int  edge)

returns the map tiles adjacent to the input edge

Map_GetTiles_AdjacentToEdge_Combined.png
blue = input edge , green = result

◆ AdjacentToEdge() [2/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.AdjacentToEdge ( Edge  edge)

returns the map tiles adjacent to the input edge

◆ AdjacentToCorner() [1/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.AdjacentToCorner ( Vector3Int  corner)

returns the map tiles adjacent to the input corner

Map_GetTiles_AdjacentToCorner_Combined.png
blue = input corner , green = result

◆ AdjacentToCorner() [2/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.AdjacentToCorner ( Corner  corner)

returns the map tiles adjacent to the input corner

◆ Cone() [1/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.Cone ( Tile  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

◆ Cone() [2/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.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

◆ Line() [1/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.Line ( Tile  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

◆ Line() [2/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.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

◆ Ring() [1/4]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.Ring ( Tile  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/4]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.Ring ( Vector3Int  center,
int  radius,
int  thicknessInwards 
)

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

◆ Ring() [3/4]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.Ring ( Tile  center,
int  radius,
TileDirection  startDirection,
bool  clockwise 
)

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

◆ Ring() [4/4]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.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)

◆ Disc() [1/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.Disc ( Tile  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

◆ Disc() [2/2]

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.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

◆ ContiguousAreasOfInputTiles() [1/2]

List<List<Tile<T> > > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.ContiguousAreasOfInputTiles ( ICollection< Tile inputTiles)

splits the input collection into 1 List for each contiguous area formed by the input tiles

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

◆ ContiguousAreasOfInputTiles() [2/2]

List<List<Tile<T> > > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.ContiguousAreasOfInputTiles ( ICollection< Vector3Int >  inputTiles)

splits the input collection into 1 List for each contiguous area formed by the input tile coordinates.

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

◆ GetTilesFromCoordinates()

List<Tile<T> > Wunderwunsch.HexMapLibrary.Generic.TilesDataProvider< T >.GetTilesFromCoordinates ( ICollection< Vector3Int >  coordinates)
private

Returns the tiles belonging to the input coordinates