org.vizzini.example.pong
Class Paddle

java.lang.Object
  extended by org.vizzini.game.AbstractToken
      extended by org.vizzini.example.pong.Paddle
All Implemented Interfaces:
Serializable, Cloneable, IToken

public class Paddle
extends AbstractToken

Provides a paddle for Pong.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.vizzini.game.AbstractToken
UNKNOWN_NAME
 
Fields inherited from interface org.vizzini.game.IToken
AGENT_PROPERTY, NAME_PROPERTY, POSITION_PROPERTY, TEAM_PROPERTY
 
Constructor Summary
Paddle()
          Construct this object.
 
Method Summary
 void configure(Properties properties, int index)
          Configure this token.
 Rectangle getBounds()
          Return the paddle bounds.
 Dimension getDimension()
          Return the paddle dimensions.
 int getSpeed()
          Return the speed.
 void setDimension(Dimension dimension)
          Set the paddle dimensions.
 void setSpeed(int speed)
          Set the speed.
 void updatePosition(Dimension bounds, boolean isUp)
          Update the paddle position.
 
Methods inherited from class org.vizzini.game.AbstractToken
addPropertyChangeListener, clone, copy, equals, getAgent, getIndex, getName, getPosition, getPropertyChangeManager, getTeam, getValue, hashCode, isFiringPositionChanges, removePropertyChangeListener, setAgent, setFiringPositionChanges, setIndex, setName, setPosition, setTeam, setValue, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Paddle

public Paddle()
Construct this object.

Since:
v0.2
Method Detail

configure

public void configure(Properties properties,
                      int index)
Configure this token.

Specified by:
configure in interface IToken
Overrides:
configure in class AbstractToken
Parameters:
properties - Source of configuration information.
index - Index of this token's properties.
Since:
v0.1

getBounds

public Rectangle getBounds()
Return the paddle bounds.

Since:
v0.1

getDimension

public Dimension getDimension()
Return the paddle dimensions.

Since:
v0.1

getSpeed

public int getSpeed()
Return the speed.

Since:
v0.1

setDimension

public void setDimension(Dimension dimension)
Set the paddle dimensions.

Since:
v0.1

setSpeed

public void setSpeed(int speed)
Set the speed.

Since:
v0.1

updatePosition

public void updatePosition(Dimension bounds,
                           boolean isUp)
Update the paddle position.

Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02