ch.sahits.game.event
Class Event

java.lang.Object
  extended by ch.sahits.game.event.Event
Direct Known Subclasses:
KeyPressEvent, MouseClickEvent, MouseMoveEvent, PlayerChangeEvent, StartEvent, TimeChangeEvent, ViewChangeEvent

public class Event
extends Object

Base class for the Events passed in the game. The queue is implemented as a FIFO queue. All methods are quarded by the same lock to ensure thread savety.

Author:
andi

Field Summary
private static ConcurrentLinkedQueue<IEventListener> listeners
           
private static Object lock
           
 
Constructor Summary
Event()
           
 
Method Summary
static void add(IEventListener listener)
           
 void notify(Object eventNotice)
           
static void remove(IEventListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private static ConcurrentLinkedQueue<IEventListener> listeners

lock

private static final Object lock
Constructor Detail

Event

public Event()
Method Detail

add

public static void add(IEventListener listener)

remove

public static void remove(IEventListener listener)

notify

public void notify(Object eventNotice)


Copyright © 2012 Sahits GmbH. All Rights Reserved.