us.asciiroth.client.event
Class Events

java.lang.Object
  extended by us.asciiroth.client.event.Events

public class Events
extends java.lang.Object

A singleton that provides a simple publish/subscribe interface for communication between controller/model and view instances.


Constructor Summary
Events()
           
 
Method Summary
 void addCellListener(CellListener listener)
          Register a cell listener.
 void addFlagsListener(FlagsListener listener)
          Register a flags listener.
 void addGameListener(GameListener listener)
          Register a game listener.
 void addInventoryListener(InventoryListener listener)
          Register an inventory listener.
 void addMessageListener(MessageListener listener)
          Add a message listener.
 void addPlayerListener(PlayerListener listener)
          Register a player listener.
 void fireCellChanged(Cell cell)
          Fire a cell changed event and notify listeners.
 void fireClearCell(Cell cell)
          Cause any messages that are positioned around the indicated cell to be removed from the board.
 void fireClearCurrentCell()
          Cause any messages that are positioned around the current cell to be removed from the board.
 void fireFlagsChanged(Agent agent)
          Fire a flags changed event and notify listeners.
 void fireGamePaused()
          Fire a game paused event and notify listeners.
 void fireGameResumed()
          Fire a game resumed event and notify listeners.
 void fireHandleInventoryMessaging()
          Display information about the items at the player's current location.
 void fireHandleModalMessage()
          Cause a modal message, which was sent out by the fireModalMessage method, to be displayed on the board.
 void fireHideAllMessages()
          Hide all messages, regardless of where they are.
 void fireInventoryChanged(PlayerBag bag)
          Fire an inventory changed event and notify listeners.
 void fireMessage(Cell cell, java.lang.String message)
          Fire a message event to be positioned relative to the indicated cell.
 void fireModalMessage(java.lang.String message)
          Fire a modal message, which is always positioned next to the player's location.
 void firePlayerChanged(Player player)
          Fire a player changed event and notify listeners.
 void fireRerender(Cell cell, Piece piece, Symbol sym)
          Fire a rerender event/request and notify listeners.
static Events get()
          Get the Events singleton
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Events

public Events()
Method Detail

addCellListener

public void addCellListener(CellListener listener)
Register a cell listener.

Parameters:
listener -

addFlagsListener

public void addFlagsListener(FlagsListener listener)
Register a flags listener.

Parameters:
listener -

addGameListener

public void addGameListener(GameListener listener)
Register a game listener.

Parameters:
listener -

addInventoryListener

public void addInventoryListener(InventoryListener listener)
Register an inventory listener.

Parameters:
listener -

addMessageListener

public void addMessageListener(MessageListener listener)
Add a message listener.

Parameters:
listener -

addPlayerListener

public void addPlayerListener(PlayerListener listener)
Register a player listener.

Parameters:
listener -

fireCellChanged

public void fireCellChanged(Cell cell)
Fire a cell changed event and notify listeners.

Parameters:
cell -

fireClearCell

public void fireClearCell(Cell cell)
Cause any messages that are positioned around the indicated cell to be removed from the board.

Parameters:
cell -

fireClearCurrentCell

public void fireClearCurrentCell()
Cause any messages that are positioned around the current cell to be removed from the board.


fireFlagsChanged

public void fireFlagsChanged(Agent agent)
Fire a flags changed event and notify listeners.

Parameters:
agent -

fireGamePaused

public void fireGamePaused()
Fire a game paused event and notify listeners.


fireGameResumed

public void fireGameResumed()
Fire a game resumed event and notify listeners.


fireHandleInventoryMessaging

public void fireHandleInventoryMessaging()
Display information about the items at the player's current location.


fireHandleModalMessage

public void fireHandleModalMessage()
Cause a modal message, which was sent out by the fireModalMessage method, to be displayed on the board.


fireHideAllMessages

public void fireHideAllMessages()
Hide all messages, regardless of where they are.


fireInventoryChanged

public void fireInventoryChanged(PlayerBag bag)
Fire an inventory changed event and notify listeners.

Parameters:
bag - the players invetory bag

fireMessage

public void fireMessage(Cell cell,
                        java.lang.String message)
Fire a message event to be positioned relative to the indicated cell.

Parameters:
cell -
message -

fireModalMessage

public void fireModalMessage(java.lang.String message)
Fire a modal message, which is always positioned next to the player's location. Such messages must be explicitly dismissed by the player.

Parameters:
message -

firePlayerChanged

public void firePlayerChanged(Player player)
Fire a player changed event and notify listeners.

Parameters:
player -

fireRerender

public void fireRerender(Cell cell,
                         Piece piece,
                         Symbol sym)
Fire a rerender event/request and notify listeners.

Parameters:
cell -
piece -
sym -

get

public static Events get()
Get the Events singleton

Returns:
the Events singleton

0.7

© 2009 Alx Dark