Class RandomUtils

java.lang.Object
com.csse3200.game.utils.math.RandomUtils

public class RandomUtils extends Object
Utility class for generating random numbers and vectors.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.badlogic.gdx.math.GridPoint2
    random(com.badlogic.gdx.math.GridPoint2 start, com.badlogic.gdx.math.GridPoint2 end)
    Generates a random GridPoint2 between two given GridPoint2s.
    static com.badlogic.gdx.math.Vector2
    random(com.badlogic.gdx.math.Vector2 start, com.badlogic.gdx.math.Vector2 end)
    Generates a random Vector2 between two given vectors.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • random

      public static com.badlogic.gdx.math.Vector2 random(com.badlogic.gdx.math.Vector2 start, com.badlogic.gdx.math.Vector2 end)
      Generates a random Vector2 between two given vectors.
      Parameters:
      start - The starting vector
      end - The ending vector
      Returns:
      A random Vector2 between the two given vectors
    • random

      public static com.badlogic.gdx.math.GridPoint2 random(com.badlogic.gdx.math.GridPoint2 start, com.badlogic.gdx.math.GridPoint2 end)
      Generates a random GridPoint2 between two given GridPoint2s.
      Parameters:
      start - The starting GridPoint2
      end - The ending GridPoint2
      Returns:
      A random GridPoint2 between the two given GridPoint2s