core

## Class VGDLRegistry

- java.lang.Object
- - core.VGDLRegistry

-     public class VGDLRegistry
      extends java.lang.Object

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

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static VGDLRegistry` | `GetInstance()` Returns the unique instance of this class.
    `java.lang.String` | `getRegisteredSpriteKey(int value)` Returns the String associated with the first (and in theory, unique) sprite value passed.
    `int` | `getRegisteredSpriteValue(java.lang.String key)` Returns the index (value in map) of a given key, for sprites.
    `void` | `init()` Initializes the registry of sprites for games.
    `int` | `numSpriteTypes()` Returns the -number of elements in the sprite_mapping array.
    `int` | `registerSprite(java.lang.String key)` Register a new sprite string.

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

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

- - ### Method Detail

    - #### init

          public void init()

      Initializes the registry of sprites for games.

    - #### GetInstance

          public static VGDLRegistry GetInstance()

      Returns the unique instance of this class.
      Returns:
        the unique instance of this class.

    - #### registerSprite

          public int registerSprite(java.lang.String key)

      Register a new sprite string.
      Parameters:
        `key` - key in the hashmap.
      Returns:
        Returns its new index, or a new one if it was already registered.

    - #### getRegisteredSpriteValue

          public int getRegisteredSpriteValue(java.lang.String key)

      Returns the index (value in map) of a given key, for sprites.
      Parameters:
        `key` - key to check
      Returns:
        the value in map, -1 if it does not exist.

    - #### getRegisteredSpriteKey

          public java.lang.String getRegisteredSpriteKey(int value)

      Returns the String associated with the first (and in theory, unique) sprite value passed. This method is for debug purposes only, should not be used for game execution.
      Parameters:
        `value` - value whose key is returned.
      Returns:
        the String associated with the value passed.

    - #### numSpriteTypes

          public int numSpriteTypes()

      Returns the -number of elements in the sprite_mapping array.
      Returns:
        number of elements in the sprite_mapping array.