feud.testgame
Class ClientEventQueue

java.lang.Object
  extended byfeud.testgame.ClientEventQueue

public class ClientEventQueue
extends java.lang.Object

This is a singleton used by the client to store events that should be transfered to the server in the next transfer. An event can be death, firing,...
The queue can contain events for different clients running in one VM.


Method Summary
 void add(Event event)
          Adds an event to the queue.
 void clear()
          Clears the queue.
 EventDataContainer getEvents(int clientID)
          Gets all events sheduled by a client.
static ClientEventQueue getInstance()
          Returns the one and only instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ClientEventQueue getInstance()
Returns the one and only instance. The queue is a singleton.

Returns:
ClientEventQueue the queue

add

public void add(Event event)
Adds an event to the queue.

Parameters:
event - Event the event to add

clear

public void clear()
Clears the queue.


getEvents

public EventDataContainer getEvents(int clientID)
Gets all events sheduled by a client.

Parameters:
clientID - int the ID of the client
Returns:
EventDataContainer the events packed into a data container