public abstract class PhysicalMapComponent extends MapComponent
Modifier and Type | Field and Description |
---|---|
protected Position |
position
The position of the map component on the map.
|
map
Constructor and Description |
---|
PhysicalMapComponent(Position position)
Create the map component at a specified
Position . |
Modifier and Type | Method and Description |
---|---|
double |
getDistance(Position position)
Gets the distance between a
Position and the component. |
Position |
getPosition()
Gets the
Position of the map component. |
abstract Vector |
getVectorToPosition(Position position)
|
abstract boolean |
isLineCollision(Position start,
Position end)
Determines if a line intersects with the
PhysicalMapComponent . |
destroy, isDestroyed, setMap
protected Position position
public double getDistance(Position position)
Position
and the component.position
- The position.public Position getPosition()
Position
of the map component.public abstract Vector getVectorToPosition(Position position)
position
- The first position.public abstract boolean isLineCollision(Position start, Position end)
PhysicalMapComponent
.start
- The start position of the line.end
- The end position of the line.