Class ImageCache

java.lang.Object
visuals.imageServers.ImageCache

public class ImageCache extends Object
Stores images for further use in ArrayLists. Implemented as a singleton.
  • Field Details

  • Constructor Details

    • ImageCache

      private ImageCache()
      Constructor. Does nothing.
  • Method Details

    • getInstance

      public static ImageCache getInstance()
      Returns the instance of the class.
      Returns:
      instance of the class
    • addToEasyCache

      public void addToEasyCache()
      Loads images used in the easy game mode to memory.
    • addToMediumCache

      public void addToMediumCache()
      Loads images used in the medium game mode to memory.
    • addToHardCache

      public void addToHardCache()
      Loads images used in the hard game mode to memory.
    • addToGameBackGroundCache

      public void addToGameBackGroundCache()
      Loads images used in the background of every game mode
    • addToMenuCache

      public void addToMenuCache()
      Loads images for the main menu
    • getMenuCache

      public ArrayList<Image> getMenuCache()
      returns images for the main menu
      Returns:
      arraylist of images
    • getGameBackGroundCache

      public ArrayList<Image> getGameBackGroundCache()
      returns background images for gamemodes
      Returns:
      arraylist of images
    • getEasyCache

      public ArrayList<Image> getEasyCache()
      returns images for the easy game mode
      Returns:
      arraylist of images
    • getMediumCache

      public ArrayList<Image> getMediumCache()
      returns images for the medium game mode
      Returns:
      arraylist of images
    • getHardCache

      public ArrayList<Image> getHardCache()
      returns images for the hard game mode
      Returns:
      arraylist of images
    • getEasyComp

      public ArrayList<Image> getEasyComp()
      Background images specfic to easuy mode
      Returns:
      arraylist of images
    • getMediumComp

      public ArrayList<Image> getMediumComp()
      Background images specfic to medium mode
      Returns:
      arraylist of images
    • getHardComp

      public ArrayList<Image> getHardComp()
      Background images specfic to hard mode
      Returns:
      arraylist of images