public class RoadDropObject extends DropObject
Modifier and Type | Field and Description |
---|---|
private Coordinate |
p1 |
private Coordinate |
p2 |
color, controller
Constructor and Description |
---|
RoadDropObject(IMapController controller,
CatanColor color)
Creates a RoadDropObject.
|
Modifier and Type | Method and Description |
---|---|
void |
Click()
Indicates the mouse button was pressed.
|
Edge |
GetDropLocation()
Gets the edge associated with the object.
|
void |
Handle(java.awt.geom.Point2D point)
Used to handle mouse movement.
|
boolean |
IsAllowed()
Returns if the object can be placed at the current location.
|
boolean |
IsValid()
Returns if the location of the object is a valid location.
|
GetClosestHexCoordinate, GetColor, GetSortedVerticies
private Coordinate p1
private Coordinate p2
public RoadDropObject(IMapController controller, CatanColor color)
controller
- The controller associated with the object.color
- The color of the object.public Edge GetDropLocation() throws MapException
MapException
- Thrown if the edge doesn't exist.public boolean IsValid()
DropObject
IsValid
in class DropObject
public boolean IsAllowed()
DropObject
IsAllowed
in class DropObject
public void Handle(java.awt.geom.Point2D point)
DropObject
Handle
in class DropObject
point
- The location of the mouse.public void Click()
DropObject
Click
in class DropObject