breakout
Class BenSimpleBrick

java.lang.Object
  |
  +--breakout.DefaultBreakoutComponent
        |
        +--breakout.BenSimpleBrick
All Implemented Interfaces:
BreakoutComponent, Brick
Direct Known Subclasses:
BallBrick, OtherBrick

public class BenSimpleBrick
extends DefaultBreakoutComponent
implements Brick

Possible student code that implements a basic brick.


Constructor Summary
BenSimpleBrick(Point location, Dimension size)
           
BenSimpleBrick(Point location, Dimension size, World w, Color c, int hp)
           
 
Method Summary
 void hitBy(BreakoutComponent striker)
          the component has been struck by the given component
 void paint(Graphics g)
          renders this component to the screen.
 
Methods inherited from class breakout.DefaultBreakoutComponent
getCenter, getLocation, getShape, getSize, isDead, isTransient, kill, setLocation, setWorld
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface breakout.BreakoutComponent
getCenter, getLocation, getShape, getSize, isDead, isTransient, kill, setLocation, setWorld
 

Constructor Detail

BenSimpleBrick

public BenSimpleBrick(Point location,
                      Dimension size,
                      World w,
                      Color c,
                      int hp)

BenSimpleBrick

public BenSimpleBrick(Point location,
                      Dimension size)
Method Detail

paint

public void paint(Graphics g)
Description copied from interface: BreakoutComponent
renders this component to the screen. Origin of graphics has been translated to upper-left corner of component.

Specified by:
paint in interface BreakoutComponent
Specified by:
paint in class DefaultBreakoutComponent

hitBy

public void hitBy(BreakoutComponent striker)
Description copied from interface: BreakoutComponent
the component has been struck by the given component

Specified by:
hitBy in interface BreakoutComponent
Specified by:
hitBy in class DefaultBreakoutComponent