org.jrabbit.base.managers
Class Resources

java.lang.Object
  extended by org.jrabbit.base.managers.Resources

public final class Resources
extends java.lang.Object

Resources is a static class that contains references to caches for each of the three main resource types - images, fonts, and sounds. It is used to provide unified access to all resources. Additionally, Resources contains its own random number generator. They're used a lot in games, so one is provided.

Author:
Chris Molini

Field Summary
private static FontCache fonts
          The cache of all fonts.
private static ImageCache images
          The cache of all Images.
private static java.util.Random random
          The random number generator.
private static Cache<SoundData> sounds
          The cache of all sound data.
 
Constructor Summary
Resources()
           
 
Method Summary
static void create()
          Initializes all resources.
static FontCache fonts()
          Accesses the FontCache.
static ImageCache images()
          Accesses the ImageCache.
static java.util.Random random()
          Accesses the random number generator.
static Cache<SoundData> sounds()
          Accesses the SoundCache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

images

private static ImageCache images
The cache of all Images.


fonts

private static FontCache fonts
The cache of all fonts.


sounds

private static Cache<SoundData> sounds
The cache of all sound data.


random

private static java.util.Random random
The random number generator.

Constructor Detail

Resources

public Resources()
Method Detail

create

public static void create()
Initializes all resources.


images

public static ImageCache images()
Accesses the ImageCache.

Returns:
The cache of images.

fonts

public static FontCache fonts()
Accesses the FontCache.

Returns:
The cache of fonts.

sounds

public static Cache<SoundData> sounds()
Accesses the SoundCache.

Returns:
The cache of sound data.

random

public static java.util.Random random()
Accesses the random number generator.

Returns:
A reference to the general Random contained by Resources.