game.collision
Class BrickHitsFloor

java.lang.Object
  extended by game.collision.CollisionHandler
      extended by game.collision.BrickHitsFloor
All Implemented Interfaces:
Subscriber<Collision>

public class BrickHitsFloor
extends CollisionHandler

Collision handler for a brick and the floor.

Author:
Ron Cytron, with changes by Jon Turner

Constructor Summary
BrickHitsFloor(Brick brick, Boundary floor, PieceMover brickMover)
          Constructor for BrickHitsFloor
 
Method Summary
 void observeEvent(Collision e)
          This method is called when collisions occur and responds appropriately.
 
Methods inherited from class game.collision.CollisionHandler
die, isDead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrickHitsFloor

public BrickHitsFloor(Brick brick,
                      Boundary floor,
                      PieceMover brickMover)
Constructor for BrickHitsFloor

Parameters:
brick - the brick being monitored
floor - the boundary object hit by the brick
brickMover - the object responsible for moving the brick
Method Detail

observeEvent

public void observeEvent(Collision e)
This method is called when collisions occur and responds appropriately. Basic action is to kill the brick.

Specified by:
observeEvent in interface Subscriber<Collision>
Specified by:
observeEvent in class CollisionHandler
Parameters:
e - The PutSubEvent, varies by Publisher.