public class HexHandler
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Integer,Hex> |
hexes |
private static int |
MAX_SIZE |
private static long |
serialVersionUID |
private static int |
Y_SHIFT |
Constructor and Description |
---|
HexHandler()
Creates a HexHandler object.
|
Modifier and Type | Method and Description |
---|---|
void |
AddHex(Hex hex)
Adds a hex object to the handler.
|
boolean |
ContainsHex(Coordinate point)
Determines if a hex is contained at the location.
|
boolean |
equals(java.lang.Object obj) |
java.util.Iterator<Hex> |
GetAllHexes()
Gets all the hexes in the map.
|
static Coordinate |
GetBottomLeft(Coordinate point) |
static Coordinate |
GetBottomRight(Coordinate point) |
Hex |
GetHex(Coordinate point)
Gets the hex at the given coordinate.
|
private int |
GetKey(Coordinate point) |
private int |
GetKey(Hex hex) |
static Coordinate |
GetLeft(Coordinate point) |
static Coordinate |
GetRight(Coordinate point) |
static Coordinate |
GetTopLeft(Coordinate point) |
static Coordinate |
GetTopRight(Coordinate point) |
int |
hashCode() |
private static final long serialVersionUID
private static final int MAX_SIZE
private static final int Y_SHIFT
private java.util.Map<java.lang.Integer,Hex> hexes
public void AddHex(Hex hex) throws MapException
hex
- The hex to add.MapException
- Thrown if attempting to add to many hexes or duplicate hexes.public boolean ContainsHex(Coordinate point)
x
- The coordinate of the hex.public Hex GetHex(Coordinate point) throws MapException
x
- The coordinate of the hex.MapException
public java.util.Iterator<Hex> GetAllHexes()
public static Coordinate GetTopLeft(Coordinate point)
public static Coordinate GetTopRight(Coordinate point)
public static Coordinate GetRight(Coordinate point)
public static Coordinate GetBottomRight(Coordinate point)
public static Coordinate GetBottomLeft(Coordinate point)
public static Coordinate GetLeft(Coordinate point)
private int GetKey(Hex hex)
private int GetKey(Coordinate point)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object