Breakout Problem Set Javadocs

breakout
Interface BreakoutComponent

All Known Subinterfaces:
ActiveBreakoutComponent, Ball, Brick
All Known Implementing Classes:
DefaultActiveBreakoutComponent, DefaultBreakoutComponent, SimpleBall

public interface BreakoutComponent

interface BreakoutComponent is the basic element of the breakout system. BreakoutComponents are renderable objects that can be added to the game's World.

Version:
$Id: BreakoutComponent.java,v 1.2 2004/03/26 20:39:33 gus Exp $
Author:
benmv@olin.edu
See Also:
World, DefaultBreakoutComponent

Method Summary
 java.awt.Point getCenter()
          returns a point at the center of the component
 java.awt.Point getLocation()
          returns location of upper-left corner of component
 java.awt.Shape getShape()
          returns the actual shape of the object.
 java.awt.Dimension getSize()
          returns the width and height of the bounding rectangle of the component.
 void hitBy(BreakoutComponent bc)
          the component has been struck by the given component
 boolean isDead()
          returns dead status of component.
 boolean isTransient()
          returns true if the component is transient.
 void kill()
          destroys this component
 void paint(java.awt.Graphics g)
          renders this component to the screen.
 void setLocation(java.awt.Point p)
          sets the location of upper-left corner of component
 void setWorld(World world)
          sets the world the component lives in
 

Method Detail

getLocation

public java.awt.Point getLocation()
returns location of upper-left corner of component

Returns:
Point location of component's upper left corner.

setLocation

public void setLocation(java.awt.Point p)
sets the location of upper-left corner of component


getCenter

public java.awt.Point getCenter()
returns a point at the center of the component

Returns:
Point center of component

getSize

public java.awt.Dimension getSize()
returns the width and height of the bounding rectangle of the component.

Returns:
Dimension extents of the component.

getShape

public java.awt.Shape getShape()
returns the actual shape of the object. Used for intersection and rebound. Shape should be in world coordinates, not local coordinates (i.e. not relative to upper left corner of component)

Returns:
Shape of component

kill

public void kill()
destroys this component


isDead

public boolean isDead()
returns dead status of component.


setWorld

public void setWorld(World world)
sets the world the component lives in


hitBy

public void hitBy(BreakoutComponent bc)
the component has been struck by the given component


paint

public void paint(java.awt.Graphics g)
renders this component to the screen. Origin of graphics has been translated to upper-left corner of component.


isTransient

public boolean isTransient()
returns true if the component is transient.

Returns:
boolean true if component is transient

Breakout Problem Set Javadocs