us.asciiroth.client.core
Class Event

java.lang.Object
  extended by us.asciiroth.client.core.Context
      extended by us.asciiroth.client.core.Event

public class Event
extends Context

A game event, with the information necessary for the callbacks on the various pieces to create a meaningful response to the event.


Constructor Summary
Event(Player player, Board board)
           
 
Method Summary
 void cancel()
          Cancel this event.
 void cancel(Cell cell, java.lang.String message)
          Cancel this event and provide an explanation to the player, pointing to the indicated cell.
 void cancel(java.lang.String message)
          Cancel this event and provide an explanation to the player, pointing to the current cell where the player is.
 boolean isCancelled()
          Is the event canceled?
 void suppressCancel()
          In the course of firing events it may be that one failure requires a further test.
 
Methods inherited from class us.asciiroth.client.core.Context
getBoard, getPlayer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Event

public Event(Player player,
             Board board)
Parameters:
player -
board -
Method Detail

cancel

public void cancel()
Cancel this event. Usually this means the originally intended action is prevented, but it can mean in certain circumstances that the normal flow of the event is changed. See the documentation for individual callback methods for details on what will happen if the event is canceled in the handling of that callback.


cancel

public void cancel(Cell cell,
                   java.lang.String message)
Cancel this event and provide an explanation to the player, pointing to the indicated cell. Note that currently, messages will only be shown on the two cells that are at either end of a directional event... were you to point somewhere else on the board, the message will not be displayed to the user.

Parameters:
cell - the cell that is the locus of the message
message - a message to display to the player

cancel

public void cancel(java.lang.String message)
Cancel this event and provide an explanation to the player, pointing to the current cell where the player is.

Parameters:
message - a message to display to the player

isCancelled

public boolean isCancelled()
Is the event canceled?

Returns:
true if the event has been canceled

suppressCancel

public void suppressCancel()
In the course of firing events it may be that one failure requires a further test. You can suppress cancel and test again. This really shouldn't be done outside of the Game singleton's controller methods, where event callbacks to the pieces are orchestrated.


0.7

© 2009 Alx Dark