breakout
Class WorldEvent

java.lang.Object
  |
  +--breakout.WorldEvent
All Implemented Interfaces:
Serializable

public class WorldEvent
extends Object
implements Serializable

class WorldEvent embodies a change to state of the World as reported to a WorldListener.

Version:
$Id: WorldEvent.html,v 1.1 2003/03/10 16:34:48 bvandiver Exp $
Author:
benmv@olin.edu
See Also:
World, WorldListener, Serialized Form

Field Summary
static int ADD_BRICK
          brick added to world event
static int BALL_TRANSFER
          ball transferred out of world event
static int REMOVE_BRICK
          brick removed from world event
 
Method Summary
static WorldEvent createEvent(int action, BreakoutComponent bc)
          factory method for building WorldEvent given a Breakout component.
 int getAction()
          getter for action
 Point getDirection()
          getter for direction
 Point getLocation()
          getter for location
 Dimension getSize()
          getter for size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD_BRICK

public static final int ADD_BRICK
brick added to world event

See Also:
Constant Field Values

REMOVE_BRICK

public static final int REMOVE_BRICK
brick removed from world event

See Also:
Constant Field Values

BALL_TRANSFER

public static final int BALL_TRANSFER
ball transferred out of world event

See Also:
Constant Field Values
Method Detail

getAction

public int getAction()
getter for action

Returns:
What happened.

getLocation

public Point getLocation()
getter for location

Returns:
Point location of component

getDirection

public Point getDirection()
getter for direction

Returns:
Point direction of component
See Also:
ActiveBreakoutComponent

getSize

public Dimension getSize()
getter for size

Returns:
Dimension size of component

createEvent

public static WorldEvent createEvent(int action,
                                     BreakoutComponent bc)
factory method for building WorldEvent given a Breakout component. Fills in direction if given an ActiveBreakoutComponent.

Parameters:
action - action that happened.
bc - Component the action relates to.