Package it.unibo.alchemist.model
Interface Obstacle
-
- All Implemented Interfaces:
-
java.io.Serializable
public interface Obstacle<V extends Vector<V>> implements Serializable
A generic obstacle in a vector space.
-
-
Method Summary
Modifier and Type Method Description abstract V
next(V start, V end)
Given a vector (starting point and end point) representing a requested move, this method computes a new end point, representing a cut version of the initial vector, modified in such a way that the end point is outside the obstacle. abstract V
nearestIntersection(V start, V end)
Given a vector (represented as a starting point and an end point), computes the intersection point between the vector and the obstacle nearest to the vector's starting point. abstract Integer
getId()
The id for this obstacle. -
-
Method Detail
-
next
abstract V next(V start, V end)
Given a vector (starting point and end point) representing a requested move, this method computes a new end point, representing a cut version of the initial vector, modified in such a way that the end point is outside the obstacle.
- Parameters:
start
- starting point of the vectorend
- ending point of the vector- Returns:
the intersection point between the vector and the obstacle nearest to the vector's starting point.
-
nearestIntersection
abstract V nearestIntersection(V start, V end)
Given a vector (represented as a starting point and an end point), computes the intersection point between the vector and the obstacle nearest to the vector's starting point.
- Parameters:
start
- starting point of the vectorend
- ending point of the vector- Returns:
the intersection point between the vector and the rectangle nearest to the vector's starting point
-
-
-
-