public class VertexHandler
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private static int |
INITIAL_CAPACITY |
private static long |
serialVersionUID |
private java.util.Map<java.lang.Integer,Vertex> |
verticies |
private static int |
Y_SHIFT |
| Constructor and Description |
|---|
VertexHandler()
Creates a VertexHandler object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
ClearVillage(Coordinate point)
Removes a city or settlement from the map.
|
boolean |
ContainsVertex(Coordinate point)
Determines if there is a vertex associated with the coordinate.
|
boolean |
equals(java.lang.Object obj) |
private int |
GetKey(Coordinate point) |
Vertex |
GetVertex(Coordinate point)
Gets the vertex at the specified coordinate.
|
java.util.Iterator<Vertex> |
GetVerticies()
Gets all the registered verticies.
|
int |
hashCode() |
void |
SetCity(Coordinate point,
CatanColor color)
Adds a city to the map.
|
void |
SetSettlement(Coordinate point,
CatanColor color)
Adds a settlement to the map.
|
private static final long serialVersionUID
private static final int INITIAL_CAPACITY
private static final int Y_SHIFT
private java.util.Map<java.lang.Integer,Vertex> verticies
public boolean ContainsVertex(Coordinate point)
point - The coordinate to check.public java.util.Iterator<Vertex> GetVerticies()
public Vertex GetVertex(Coordinate point) throws MapException
point - The coordinate of the vertex.MapException - Thrown if the vertex doesn't exist.public void ClearVillage(Coordinate point) throws MapException
point - The coordinate to remove it from.MapException - Why the village couldn't be removed.public void SetSettlement(Coordinate point, CatanColor color) throws MapException
point - The point to add the settlement to.color - The color of the settlement (this sounds a little racist ... don't take it
out of context).MapException - Why the settlement couldn't be added.public void SetCity(Coordinate point, CatanColor color) throws MapException
point - The point to add the city to.color - The color of the city.MapException - Why the city couldn't be added.private int GetKey(Coordinate point)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object