HexMapLibrary
Public Member Functions | Protected Member Functions | Properties | Private Attributes | List of all members
Wunderwunsch.HexMapLibrary.MapElement Class Reference

Base Class for Tile and Edge , containing index, position and normalized position of the tile or edge. More...

Inheritance diagram for Wunderwunsch.HexMapLibrary.MapElement:
Wunderwunsch.HexMapLibrary.Corner Wunderwunsch.HexMapLibrary.Edge Wunderwunsch.HexMapLibrary.Tile Wunderwunsch.HexMapLibrary.Generic.Corner< C > Wunderwunsch.HexMapLibrary.Generic.Edge< E > Wunderwunsch.HexMapLibrary.Generic.Tile< T >

Public Member Functions

override string ToString ()
 returns a string with 3 Lines, one each for Index, Position and NormalizedPosition More...
 

Protected Member Functions

 MapElement (Vector3Int position, int index, Vector2 normalizedPosition)
 base constructor called by derived classes of MapElement More...
 

Properties

int Index [get, private set]
 index of the MapElement, HexMap.Tiles , HexMap.Edges and HexMap.Corners arrays are mapped based on this. Can be arbitrarily chosen as long as it starts with 0 and has no gaps. More...
 
Vector3Int Position [get, private set]
 coordinate of the MapElement More...
 
abstract Vector3 CartesianPosition [get]
 returns the cartesian coordinate of the MapElement More...
 
Vector2 NormalizedPosition [get, private set]
 position normalised to a range of [0...1] based on the boundingbox of the map tiles,edges or corners More...
 

Private Attributes

dynamic map
 

Detailed Description

Base Class for Tile and Edge , containing index, position and normalized position of the tile or edge.

Constructor & Destructor Documentation

◆ MapElement()

Wunderwunsch.HexMapLibrary.MapElement.MapElement ( Vector3Int  position,
int  index,
Vector2  normalizedPosition 
)
protected

base constructor called by derived classes of MapElement

Member Function Documentation

◆ ToString()

override string Wunderwunsch.HexMapLibrary.MapElement.ToString ( )

returns a string with 3 Lines, one each for Index, Position and NormalizedPosition

Property Documentation

◆ Index

int Wunderwunsch.HexMapLibrary.MapElement.Index
getprivate set

index of the MapElement, HexMap.Tiles , HexMap.Edges and HexMap.Corners arrays are mapped based on this. Can be arbitrarily chosen as long as it starts with 0 and has no gaps.

◆ Position

Vector3Int Wunderwunsch.HexMapLibrary.MapElement.Position
getprivate set

coordinate of the MapElement

◆ CartesianPosition

abstract Vector3 Wunderwunsch.HexMapLibrary.MapElement.CartesianPosition
get

returns the cartesian coordinate of the MapElement

◆ NormalizedPosition

Vector2 Wunderwunsch.HexMapLibrary.MapElement.NormalizedPosition
getprivate set

position normalised to a range of [0...1] based on the boundingbox of the map tiles,edges or corners