tools

## Class Utils

- java.lang.Object
- - tools.Utils

-     public class Utils
      extends java.lang.Object

  Created with IntelliJ IDEA. User: Diego Date: 17/10/13 Time: 12:13 This is a Java port from Tom Schaul's VGDL - https://github.com/schaul/py-vgdl

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Utils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `argmax(double[] values)`
    `static Vector2d` | `choice(java.util.ArrayList<Vector2d> elements, java.util.Random rnd)`
    `static java.lang.Object` | `choice(java.lang.Object[] elements, java.util.Random rnd)`
    `static java.lang.String` | `formatString(java.lang.String str)`
    `static double` | `normalise(double a_value, double a_min, double a_max)`
    `static Vector2d` | `processMovementActionKeys(boolean[] key_pressed)`
    `static boolean` | `processUseKey(boolean[] key_pressed)`
    `static java.awt.Polygon` | `roundedPoints(java.awt.Rectangle rect)`
    `static java.awt.Polygon` | `triPoints(java.awt.Rectangle rect, Vector2d orientation)` Returns the Polygon for a triangle in the middle of the provided rect, pointing in the orientation (given as angle from upwards, or orientation vector)

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Utils

          public Utils()

  - ### Method Detail

    - #### choice

          public static java.lang.Object choice(java.lang.Object[] elements,
                                java.util.Random rnd)

    - #### choice

          public static Vector2d choice(java.util.ArrayList<Vector2d> elements,
                        java.util.Random rnd)

    - #### formatString

          public static java.lang.String formatString(java.lang.String str)

    - #### triPoints

          public static java.awt.Polygon triPoints(java.awt.Rectangle rect,
                                   Vector2d orientation)

      Returns the Polygon for a triangle in the middle of the provided rect, pointing in the orientation (given as angle from upwards, or orientation vector)
      Parameters:
        `rect` - rectangle with the location
        `orientation` - orientation of the sprite.
      Returns:
        a polygon (triangle) with the specified orientation.

    - #### roundedPoints

          public static java.awt.Polygon roundedPoints(java.awt.Rectangle rect)

    - #### processMovementActionKeys

          public static Vector2d processMovementActionKeys(boolean[] key_pressed)

    - #### normalise

          public static double normalise(double a_value,
                         double a_min,
                         double a_max)

    - #### processUseKey

          public static boolean processUseKey(boolean[] key_pressed)

    - #### argmax

          public static int argmax(double[] values)