Breakout Problem Set Javadocs

breakout
Interface BreakoutComponent

All Known Subinterfaces:
Ball, Brick, Paddle, Wall
All Known Implementing Classes:
BasicBall, BasicBreakoutComponent, BasicBrick, BasicPaddle, BasicWall

public interface BreakoutComponent

Defines the contract for all BreakoutComponent objects.


Method Summary
 java.awt.Point getLocation()
          Provides a way to get the location of this BreakoutComponent.
 java.awt.Shape getShape()
          Provides a way to get the java.awt.Shape of this BreakoutComponent, generally for intersection and rebound checks.
 java.awt.Dimension getSize()
          Provides a way to get the size of this BreakoutComponent.
 boolean hit(BreakoutComponent bc)
          Used in the rebound phase of a World tick.
 void paint(java.awt.Graphics g)
          Provides a way to paint this BreakoutComponent.
 void setLocation(java.awt.Point p)
          Provides a way to set the location of this BreakoutComponent.
 void update()
          Called by World at the beginning of evey tick on all BreakoutComponents in a Board.
 

Method Detail

setLocation

public void setLocation(java.awt.Point p)
Provides a way to set the location of this BreakoutComponent.


getLocation

public java.awt.Point getLocation()
Provides a way to get the location of this BreakoutComponent.


getSize

public java.awt.Dimension getSize()
Provides a way to get the size of this BreakoutComponent.


update

public void update()
Called by World at the beginning of evey tick on all BreakoutComponents in a Board.


hit

public boolean hit(BreakoutComponent bc)
Used in the rebound phase of a World tick.

Objects that implement Rebounding will check the board to see if they intersect with anything. If they do, they will call this method on the offending BreakoutComponent. If the response is true, the BreakoutComponent should be removed from the Board.

Parameters:
bc - the BreakoutComponent that's doing the hitting.
Returns:
true

getShape

public java.awt.Shape getShape()
Provides a way to get the java.awt.Shape of this BreakoutComponent, generally for intersection and rebound checks.


paint

public void paint(java.awt.Graphics g)
Provides a way to paint this BreakoutComponent. Note that the upper-left hand corner of this component is at (0,0) according to the Graphics object passed to this method by BoardPanel.

See Also:
BoardPanel

Breakout Problem Set Javadocs