Class Prisoners


  • public class Prisoners
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Prisoners​(com.badlogic.gdx.maps.tiled.TiledMapTileLayer layer)
      Class constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addPrisoner​(com.badlogic.gdx.graphics.g2d.Sprite sprite)
      Adds a prisoner to the list of prisoners and spawns them in the brig.
      static void addPrisoner​(com.badlogic.gdx.graphics.g2d.Sprite sprite, int x, int y)
      Adds a prisoner to the list of prisoners at a specific location.
      static java.lang.String encode()
      Encodes the prisoners to a string for saving.
      static com.badlogic.gdx.utils.Array<com.badlogic.gdx.math.Vector2> findBrigLocations​(com.badlogic.gdx.maps.tiled.TiledMapTileLayer tileLayer)
      Scans every tile and adds a vector2 with the position of the tile with the property "prison".
      static void loadFromString​(java.lang.String value1)
      Loads the prisoners from a string.
      static void render​(com.badlogic.gdx.graphics.g2d.Batch batch)
      Renders the sprites in the prison.
      • Methods inherited from class java.lang.Object

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

      • Prisoners

        public Prisoners​(com.badlogic.gdx.maps.tiled.TiledMapTileLayer layer)
        Class constructor.
        Parameters:
        layer - The layer that the prison tiles are on.
    • Method Detail

      • findBrigLocations

        public static com.badlogic.gdx.utils.Array<com.badlogic.gdx.math.Vector2> findBrigLocations​(com.badlogic.gdx.maps.tiled.TiledMapTileLayer tileLayer)
        Scans every tile and adds a vector2 with the position of the tile with the property "prison".
        Parameters:
        tileLayer - Layer to scan for tiles
        Returns:
        Array of positions of tiles
      • addPrisoner

        public static void addPrisoner​(com.badlogic.gdx.graphics.g2d.Sprite sprite)
        Adds a prisoner to the list of prisoners and spawns them in the brig.
        Parameters:
        sprite - Sprite of npc to put in prison
      • addPrisoner

        public static void addPrisoner​(com.badlogic.gdx.graphics.g2d.Sprite sprite,
                                       int x,
                                       int y)
        Adds a prisoner to the list of prisoners at a specific location.
        Parameters:
        sprite - The sprite of the NPC to place in prison.
        x - The x position to place the NPC at.
        y - The y position to place the NPC at.
      • render

        public static void render​(com.badlogic.gdx.graphics.g2d.Batch batch)
        Renders the sprites in the prison.
        Parameters:
        batch - Batch to draw the sprites in
      • encode

        public static java.lang.String encode()
        Encodes the prisoners to a string for saving.
        Returns:
        The prisoners, encoded as a string.
      • loadFromString

        public static void loadFromString​(java.lang.String value1)
        Loads the prisoners from a string.
        Parameters:
        value1 - The string to load the prisoners from.