Interface Obstacle

  • All Implemented Interfaces:
    java.io.Serializable

    
    public interface Obstacle<V extends Vector<V>>
     implements Serializable
                        

    A generic obstacle in a vector space.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 vector
        end - 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 vector
        end - ending point of the vector
        Returns:

        the intersection point between the vector and the rectangle nearest to the vector's starting point