com.planeth.gtroids.obj.bonus
Class AbstractBonusItem

java.lang.Object
  extended bycom.planeth.gtroids.obj.base.PaintableObject
      extended bycom.planeth.gtroids.obj.base.AbstractGameObject
          extended bycom.planeth.gtroids.obj.base.AbstractPhysicalObject
              extended bycom.planeth.gtroids.obj.base.AbstractAnimatedObject
                  extended bycom.planeth.gtroids.obj.base.AbstractTumblingObject
                      extended bycom.planeth.gtroids.obj.bonus.AbstractBonusItem
All Implemented Interfaces:
ITimeControllable
Direct Known Subclasses:
BonusBomb, BonusCure, BonusGravit, BonusPointsFactor, BonusShield, BonusShip, BonusShot, BonusSpeed

public abstract class AbstractBonusItem
extends AbstractTumblingObject

Abstract base of a Bonus item

Author:
Andreas Grässer, gal@planet-h.com.
created 04.10.2005

Constructor Summary
AbstractBonusItem(Shape baseShape)
          Constructor for AbstractBonusItem.
 
Method Summary
protected  void applyBonus(Ship ship)
          Applies the Bonus to the passed ship
protected  void applyDamage()
          Applies the Damage
protected static Shape createBonusShape(java.awt.Color color)
          Creates a BonusShape with the passed color
 void die()
          Initates the dead of the Object without any game relevant changes like updating healthPoints and updating players points
protected  Transform getTransform()
          Returns the transform.
 void hitWith(AbstractGameObject abstractGameObject)
          Hits this object with the passed AbstractGameObject
 
Methods inherited from class com.planeth.gtroids.obj.base.AbstractTumblingObject
move, update
 
Methods inherited from class com.planeth.gtroids.obj.base.AbstractAnimatedObject
checkBorderJump, getCircumferentialVel, getLastPos, getRealTimeControl, getRotationVelDeg, getVel, isSpeedDependent, paint, pause, setBorderJumper, setCircumferentialVel, setRotationVelDeg, setSpeedDependent, setVel, update
 
Methods inherited from class com.planeth.gtroids.obj.base.AbstractPhysicalObject
getCenterOfMass, getElast, getExplodeSound, getGamePanel, getGravit, getObjectFactory, getQuadrantCoords, getVolume, hitWithBomb, isAffectingGame, setAffectingGame, setGamePanel, setGravit, setLifeTime, setQuadrantCoords, split
 
Methods inherited from class com.planeth.gtroids.obj.base.AbstractGameObject
cure, getAudioResource, getColorBackup, getStats, getTimerManager, initStats, isEnemy, isReadyToDie, kill, setColorBackup, setColorFixed, setReadyToDie
 
Methods inherited from class com.planeth.gtroids.obj.base.PaintableObject
addShape, explodeBaseShape, getAvgDiameter, getAvgVector, getBaseColor, getBaseVertexes, getBounds, getMaxRadius, getNrOfVertexes, getOrientation, getPos, paintAtPos, randomizeBaseShape, rotate, setBaseColor, splitBaseShape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBonusItem

public AbstractBonusItem(Shape baseShape)
Constructor for AbstractBonusItem.

Parameters:
baseShape - the baseShape of the object
Method Detail

createBonusShape

protected static Shape createBonusShape(java.awt.Color color)
Creates a BonusShape with the passed color

Parameters:
color - the desired color
Returns:
Returns a BonusShape

applyBonus

protected void applyBonus(Ship ship)
Applies the Bonus to the passed ship

Parameters:
ship - to apply the bonus

applyDamage

protected void applyDamage()
Applies the Damage


hitWith

public void hitWith(AbstractGameObject abstractGameObject)
Description copied from class: AbstractGameObject
Hits this object with the passed AbstractGameObject

Overrides:
hitWith in class AbstractPhysicalObject
See Also:
AbstractGameObject.hitWith(com.planeth.gtroids.obj.base.AbstractGameObject)

die

public void die()
Description copied from class: AbstractGameObject
Initates the dead of the Object without any game relevant changes like updating healthPoints and updating players points

Overrides:
die in class AbstractPhysicalObject
See Also:
AbstractGameObject.die()

getTransform

protected Transform getTransform()
Returns the transform.

Returns:
Returns the transform.