|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgizmoball.board.Gizmo
gizmoball.board.Absorber
public class Absorber
This class represents an absorber gizmo that extends the abstract gizmo class. When a ball hits an Absorber object, the absorber absorbs the ball and shoots it from its right side.
| Field Summary |
|---|
| Fields inherited from class gizmoball.board.Gizmo |
|---|
color, connections, name, reverseConnections |
| Constructor Summary | |
|---|---|
Absorber(java.lang.String name,
java.awt.Color color,
Polygon poly,
Vect launchVelocity,
GizmoBoard board)
Constructs a new Absorber gizmo. |
|
| Method Summary | |
|---|---|
void |
absorbBall(Ball b)
absorbs a ball |
void |
action()
executes the action of the Absorber which is to shoot balls that are absorbed in it. |
java.util.List<Ball> |
getBalls()
returns the balls that the absorbers have. |
Polygon |
getShape()
returns the shape of the absorber. |
void |
triggerConnections(Ball b)
overrides the triggerConnection of Gizmo |
| Methods inherited from class gizmoball.board.Gizmo |
|---|
getColor, getName, getTriggeredGizmos, getTriggeringGizmos, setColor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Absorber(java.lang.String name,
java.awt.Color color,
Polygon poly,
Vect launchVelocity,
GizmoBoard board)
name - the name of the absorbercolor - the color of the absorberpoly - the shape of the absorberlaunchVelocity - velocity of a ball when launchedboard - the board the absorber is being added to| Method Detail |
|---|
public Polygon getShape()
getShape in class Gizmopublic java.util.List<Ball> getBalls()
public void absorbBall(Ball b)
b - ballpublic void triggerConnections(Ball b)
triggerConnections in class Gizmob - ballpublic void action()
action in class Gizmo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||