edu.uiuc.cs397rhc.game
Class Simulator

java.lang.Object
  extended by edu.uiuc.cs397rhc.game.Simulator
All Implemented Interfaces:
java.util.EventListener, GameEventSource, GameListener

public class Simulator
extends java.lang.Object
implements GameEventSource, GameListener

Provides a GUI to allow testing of various game events.

Author:
Steven N. Severinghaus

Constructor Summary
Simulator()
          Constructs a new game event simulator.
 
Method Summary
 void addGameListener(GameListener l)
          Registers a GameListener to receive events from this source.
 void fireGameEvent(GameEvent ge)
          Fires a game event off to every registered listener.
 void gameUpdate(GameEvent ge)
          Notifies this listener that an event has happened in the game.
static void main(java.lang.String[] args)
          Launches the event simulation GUI.
 void removeGameListener(GameListener l)
          Removes a registered listener from the list receiving events.
 void setMood(GameUtils.Mood mood)
           
 void setScores(java.util.EnumMap<GameUtils.Team,java.lang.Integer> scores)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Simulator

public Simulator()
Constructs a new game event simulator. Causes the GUI to be constructed and displayed.

Method Detail

main

public static void main(java.lang.String[] args)
Launches the event simulation GUI. Launches GUI threadsafely.


gameUpdate

public void gameUpdate(GameEvent ge)
Description copied from interface: GameListener
Notifies this listener that an event has happened in the game.

Specified by:
gameUpdate in interface GameListener
Parameters:
ge - the event that has transpired

setMood

public void setMood(GameUtils.Mood mood)

setScores

public void setScores(java.util.EnumMap<GameUtils.Team,java.lang.Integer> scores)

addGameListener

public void addGameListener(GameListener l)
Registers a GameListener to receive events from this source.

Specified by:
addGameListener in interface GameEventSource

removeGameListener

public void removeGameListener(GameListener l)
Removes a registered listener from the list receiving events.

Specified by:
removeGameListener in interface GameEventSource

fireGameEvent

public void fireGameEvent(GameEvent ge)
Fires a game event off to every registered listener.

Specified by:
fireGameEvent in interface GameEventSource
Parameters:
ge - the game event to fire