|
Breakout Problem Set Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbreakout.BasicBrick
A basic implementation of the Brick interface.
| Field Summary | |
protected java.awt.Point |
location
The location of this BasicBrick. |
protected java.awt.Dimension |
size
The size of this BasicBrick. |
| Constructor Summary | |
BasicBrick(int width,
int height)
Creates a new BasicBrick of the specified dimensions. |
|
| Method Summary | |
java.awt.Point |
getLocation()
Gets the location of this BasicBrick. |
java.awt.Shape |
getShape()
Gets the java.awt.Shape of this BasicBrick. |
java.awt.Dimension |
getSize()
Gets the size of this BasicBrick. |
boolean |
hit(BreakoutComponent bc)
Called by a Rebounding BreakoutComponent when it has detected an intersection with this BasicBrick. |
void |
paint(java.awt.Graphics g)
Paints the BasicBrick. |
void |
setLocation(java.awt.Point p)
Sets the location of this BasicBrick. |
void |
update()
Called by World every tick; by default does nothing. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.awt.Point location
protected java.awt.Dimension size
| Constructor Detail |
public BasicBrick(int width,
int height)
width - The intended width of the BasicBrick.height - The intended height of the BasicBrick.| Method Detail |
public void setLocation(java.awt.Point p)
setLocation in interface BreakoutComponentp - a Point object representing the intended location
of this BasicBrick.public java.awt.Point getLocation()
getLocation in interface BreakoutComponentpublic java.awt.Dimension getSize()
getSize in interface BreakoutComponentpublic void update()
update in interface BreakoutComponentpublic boolean hit(BreakoutComponent bc)
hit in interface BreakoutComponentbc - the Rebounding/BreakoutComponent object that detected the intersection.
true -- a BasicBrick dies when it is hit.public java.awt.Shape getShape()
getShape in interface BreakoutComponentpublic void paint(java.awt.Graphics g)
paint in interface BreakoutComponentg - Graphics object for this ball's coordinate frame(ie, already located where we are).BoardPanel
|
Breakout Problem Set Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||