HexMapLibrary
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic Class Reference
Inheritance diagram for Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic:
Wunderwunsch.HexMapLibrary.CoordinateWrapper

Public Member Functions

 CoordinateWrapperRectangularHorizontalPeriodic (Vector2Int mapSize)
 constructor which sets the mapSize; More...
 
override Vector3 WrapCartesianCoordinate (Vector3 position)
 Returns the closest periodic coordinate of the input cartesian coordinate. More...
 
override Vector3Int WrapTileCoordinate (Vector3Int position)
 Returns the closest periodic coordinate of the input tile coordinate - Assumes coordinates are not further than 1 map size away from actual map
 
override List< Vector3Int > WrapTileCoordinates (List< Vector3Int > collection)
 Returns the closest periodic coordinates of a collection of tile coordinates. Assumes coordinates are not further than 1 map size away from actual map More...
 
override Vector3Int ShiftTargetToClosestPeriodicTilePosition (Vector3Int origin, Vector3Int target)
 This returns the closest "virtual" position of target tile position on a wrapping map, intended to be used in distance calculations TODO ADD BETTER EXPLANATION More...
 
override Vector3Int ShiftTargetToClosestPeriodicEdgePosition (Vector3Int origin, Vector3Int target)
 TODO ADD DESCRIPTION More...
 
override Vector3Int ShiftTargetToClosestPeriodicCornerPosition (Vector3Int origin, Vector3Int target)
 TODO ADD DESCRIPTION More...
 
override Vector3Int WrapEdgeCoordinate (Vector3Int position)
 returns the closest periodic edge position of the input edge position - Assumes coordinates are not further than 1 map size away from actual map More...
 
override List< Vector3Int > WrapEdgeCoordinates (List< Vector3Int > collection)
 Returns the closest periodic coordinates of a collection of edge coordinates. Assumes coordinates are not further than 1 map size away from actual map More...
 
override Vector3Int WrapCornerCoordinate (Vector3Int position)
 returns the closest periodic corner position of the input corner position - Assumes coordinates are not further than 1 map size away from actual map More...
 
override List< Vector3Int > WrapCornerCoordinates (List< Vector3Int > collection)
 Returns the closest periodic coordinates of a collection of corner coordinates. Assumes coordinates are not further than 1 map size away from actual map More...
 

Private Attributes

Vector2Int mapSize
 mapSize in tiles along offset coordinates More...
 

Static Private Attributes

static float sqrt3 = Mathf.Sqrt(3)
 cached value of square root of 3. More...
 

Constructor & Destructor Documentation

◆ CoordinateWrapperRectangularHorizontalPeriodic()

Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.CoordinateWrapperRectangularHorizontalPeriodic ( Vector2Int  mapSize)

constructor which sets the mapSize;

Member Function Documentation

◆ WrapCartesianCoordinate()

override Vector3 Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.WrapCartesianCoordinate ( Vector3  position)
virtual

Returns the closest periodic coordinate of the input cartesian coordinate.

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

◆ WrapTileCoordinates()

override List<Vector3Int> Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.WrapTileCoordinates ( List< Vector3Int >  collection)
virtual

Returns the closest periodic coordinates of a collection of tile coordinates. Assumes coordinates are not further than 1 map size away from actual map

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

◆ ShiftTargetToClosestPeriodicTilePosition()

override Vector3Int Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.ShiftTargetToClosestPeriodicTilePosition ( Vector3Int  origin,
Vector3Int  target 
)
virtual

This returns the closest "virtual" position of target tile position on a wrapping map, intended to be used in distance calculations TODO ADD BETTER EXPLANATION

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

◆ ShiftTargetToClosestPeriodicEdgePosition()

override Vector3Int Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.ShiftTargetToClosestPeriodicEdgePosition ( Vector3Int  origin,
Vector3Int  target 
)
virtual

TODO ADD DESCRIPTION

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

◆ ShiftTargetToClosestPeriodicCornerPosition()

override Vector3Int Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.ShiftTargetToClosestPeriodicCornerPosition ( Vector3Int  origin,
Vector3Int  target 
)
virtual

TODO ADD DESCRIPTION

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

◆ WrapEdgeCoordinate()

override Vector3Int Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.WrapEdgeCoordinate ( Vector3Int  position)
virtual

returns the closest periodic edge position of the input edge position - Assumes coordinates are not further than 1 map size away from actual map

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

◆ WrapEdgeCoordinates()

override List<Vector3Int> Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.WrapEdgeCoordinates ( List< Vector3Int >  collection)
virtual

Returns the closest periodic coordinates of a collection of edge coordinates. Assumes coordinates are not further than 1 map size away from actual map

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

◆ WrapCornerCoordinate()

override Vector3Int Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.WrapCornerCoordinate ( Vector3Int  position)
virtual

returns the closest periodic corner position of the input corner position - Assumes coordinates are not further than 1 map size away from actual map

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

◆ WrapCornerCoordinates()

override List<Vector3Int> Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.WrapCornerCoordinates ( List< Vector3Int >  collection)
virtual

Returns the closest periodic coordinates of a collection of corner coordinates. Assumes coordinates are not further than 1 map size away from actual map

Implements Wunderwunsch.HexMapLibrary.CoordinateWrapper.

Member Data Documentation

◆ mapSize

Vector2Int Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.mapSize
private

mapSize in tiles along offset coordinates

◆ sqrt3

float Wunderwunsch.HexMapLibrary.CoordinateWrapperRectangularHorizontalPeriodic.sqrt3 = Mathf.Sqrt(3)
staticprivate

cached value of square root of 3.