com.realtime.crossfire.jxclient.faces
Class FaceCache

java.lang.Object
  extended by com.realtime.crossfire.jxclient.faces.FaceCache

public class FaceCache
extends java.lang.Object

A cache for Face instances.


Field Summary
private  CrossfireFaceListener crossfireFaceListener
          The listener to receive face commands.
private  Face[] faces
          The cached faces.
 
Constructor Summary
FaceCache()
          Creates a new instance.
FaceCache(CrossfireServerConnection crossfireServerConnection)
          Creates a new instance.
 
Method Summary
 void addFace(Face face)
          Adds a new face to the cache.
 Face getFace(int faceNum)
          Returns a face by face id.
 void reset()
          Forgets about all face information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crossfireFaceListener

@NotNull
private final CrossfireFaceListener crossfireFaceListener
The listener to receive face commands.


faces

@NotNull
private final Face[] faces
The cached faces. Empty slots are set to null.

Constructor Detail

FaceCache

public FaceCache()
Creates a new instance.


FaceCache

public FaceCache(@NotNull
                 CrossfireServerConnection crossfireServerConnection)
Creates a new instance.

Parameters:
crossfireServerConnection - the server connection to use
Method Detail

addFace

public void addFace(@NotNull
                    Face face)
Adds a new face to the cache.

Parameters:
face - the face to add

getFace

@NotNull
public Face getFace(int faceNum)
Returns a face by face id.

Parameters:
faceNum - the face id to look up
Returns:
the face

reset

public void reset()
Forgets about all face information. Should be called when connecting to a Crossfire server.