Class VectorFactory


  • public class VectorFactory
    extends java.lang.Object
    Contains static methods to create various vectors.
    • Constructor Summary

      Constructors 
      Constructor Description
      VectorFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.badlogic.gdx.math.Vector2 boatPosition​(float laneLeftBound, int laneWidth)
      Returns a boat's starting position in a lane
      static com.badlogic.gdx.math.Vector2 randomPosition​(EntityType entityType, float laneLeftBound, int laneWidth)
      Returns a random position inside of a lane.
      • Methods inherited from class java.lang.Object

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

      • VectorFactory

        public VectorFactory()
    • Method Detail

      • randomPosition

        public static com.badlogic.gdx.math.Vector2 randomPosition​(EntityType entityType,
                                                                   float laneLeftBound,
                                                                   int laneWidth)
        Returns a random position inside of a lane.
        Parameters:
        entityType - type of an entity this is the position of.
        laneLeftBound - x value of the left edge of the lane.
        laneWidth - width of the lane
        Returns:
        Vector2 of the position
      • boatPosition

        public static com.badlogic.gdx.math.Vector2 boatPosition​(float laneLeftBound,
                                                                 int laneWidth)
        Returns a boat's starting position in a lane
        Parameters:
        laneLeftBound - x value of the left edge of the lane.
        laneWidth - width of the lane
        Returns:
        Vector2 of the position