Enum Class TexturePack.Images

java.lang.Object
java.lang.Enum<TexturePack.Images>
nz.ac.vuw.ecs.swen225.gp6.renderer.TexturePack.Images
All Implemented Interfaces:
Serializable, Comparable<TexturePack.Images>, Constable
Enclosing class:
TexturePack

public static enum TexturePack.Images extends Enum<TexturePack.Images>
This enum is for holding all the images used in the game.
  • Enum Constant Details

  • Method Details

    • values

      public static TexturePack.Images[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TexturePack.Images valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getImage

      public static BufferedImage getImage(TexturePack.Images img)
      get the image.
      Parameters:
      img - the image enum to extract the image from
      Returns:
      BufferedImage
    • getImage

      public static BufferedImage getImage(Tile tile)
      get the image for the Tile provided.
      Parameters:
      tile - the tile to extract the image from
      Returns:
      BufferedImage
    • getImage

      public static BufferedImage getImage(String imgName)
      get the image for the String provided.
      Parameters:
      imgName - the name of the image to extract the image from
      Returns:
      BufferedImage
    • loadCustom

      public static BufferedImage loadCustom(String path)
      load the image from the file.
      Parameters:
      path - the path of the image
      Returns:
      BufferedImage
    • reloadAllTexturePack

      public static void reloadAllTexturePack()
      reload all the images and caches them when changing texture packs.
    • getName

      public String getName()
      get the name.
      Returns:
      String
    • getImg

      public BufferedImage getImg()
      get the image that is cashed.
      Returns:
      BufferedImage
    • loadImg

      public BufferedImage loadImg(String imageName)
      load the image from the disk.
      Parameters:
      imageName - the name of the image
      Returns:
      BufferedImage