Class SpriteCache

java.lang.Object
games.stendhal.client.sprite.SpriteCache

public class SpriteCache extends Object
A cache of keyed sprites.
  • Constructor Details

    • SpriteCache

      public SpriteCache()
      Create a sprite cache.
  • Method Details

    • add

      public void add(Object key, Sprite sprite)
      Add a sprite to the cache.
      Parameters:
      key - The cache key.
      sprite - The sprite to add.
    • get

      public static SpriteCache get()
      Get the shared instance.
      Returns:
      The shared [singleton] instance.
    • get

      public Sprite get(Object key)
      Get a cached sprite.
      Parameters:
      key - The cache key.
      Returns:
      A sprite, or null if not found.