public class PortHandler
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private java.util.Map<Coordinate,Hex> |
cPorts |
private java.util.Map<Edge,Hex> |
ePorts |
private static int |
INITIAL_CAPACITY |
private static long |
serialVersionUID |
Constructor and Description |
---|
PortHandler()
Creates a PortHandler object.
|
Modifier and Type | Method and Description |
---|---|
void |
AddPort(PortType type,
Edge edge,
Hex hex)
Adds a port to a hex.
|
boolean |
ContainsPort(Coordinate vertex)
Determines if there is a port at the requested vertex.
|
boolean |
equals(java.lang.Object obj) |
PortType |
GetPort(Coordinate vertex)
Gets the port at the specified vertex.
|
java.util.Iterator<java.util.Map.Entry<Edge,Hex>> |
GetPorts()
Gets all the available ports.
|
int |
hashCode() |
private static final long serialVersionUID
private static final int INITIAL_CAPACITY
private java.util.Map<Coordinate,Hex> cPorts
public void AddPort(PortType type, Edge edge, Hex hex) throws MapException
type
- The type of port being added.edge
- The edge the port is on.hex
- The hex the port is on.MapException
- Don't add ports to dry land unless you wan't this exception.public boolean ContainsPort(Coordinate vertex)
vertex
- The vertex coordinate.public PortType GetPort(Coordinate vertex) throws MapException
vertex
- The desired vertex.MapException
- Thrown if there isn't a port at the vertex.public java.util.Iterator<java.util.Map.Entry<Edge,Hex>> GetPorts()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object