moagg.model.object.sprite
Class Ship

java.lang.Object
  extended by com.golden.gamedev.object.Sprite
      extended by com.golden.gamedev.object.AnimatedSprite
          extended by moagg.model.object.sprite.AbstractMoaggAnimatedSprite
              extended by moagg.model.object.sprite.Ship
All Implemented Interfaces:
java.io.Serializable, ControllableObject, DestroyableObject, LandableObject, MoaggGameObject, ShooterObject
Direct Known Subclasses:
GhostShip

public class Ship
extends AbstractMoaggAnimatedSprite
implements MoaggGameObject, ControllableObject, ShooterObject, LandableObject, DestroyableObject

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.golden.gamedev.object.Sprite
defaultCollisionShape, height, width
 
Constructor Summary
Ship()
           
 
Method Summary
 void destroy()
          Calling this method will initiate the destruction of this object.
 void dropCrate(Crate crate)
           
 double getAngle()
           
 java.util.List<Crate> getCrates()
           
 long getFuel()
           
 long getFuelCapacity()
           
 long getFuelPerMilliSecond()
           
 int getHealth()
           
 Platform getLandedPlatform()
           
 Rectangle getLandingZone()
           
 long getMass()
           
 java.lang.String getName()
           
 Rotation getRotation()
           
 double getRotationSpeed()
           
 int getScorePoints()
           
 int getShipType()
           
 double getThrustForce()
           
 Weapon getWeapon()
           
 boolean hasCapacityForCrate(Crate crate)
           
 boolean hasCrate(Crate crate)
           
 boolean hasCrates()
           
 boolean isAligned()
           
 boolean isLanded()
           
 boolean isThrust()
           
 void pickupCrate(Crate crate)
           
 void setAngle(double angle)
           
 void setFuel(long fuel)
           
 void setFuelCapacity(long fuelCapacity)
           
 void setFuelPerMilliSecond(long fuelPerMilliSecond)
           
 void setHealth(int health)
           
 void setLandedPlatform(Platform landedPlatform)
           
 void setMass(long mass)
           
 void setName(java.lang.String name)
           
 void setRotation(Rotation rotation)
           
 void setRotationSpeed(double rotationSpeed)
           
 void setShipType(int shipType)
           
 void setThrust(boolean thrust)
           
 void setThrustForce(double thrustForce)
           
 void setWeapon(Weapon weapon)
           
 void update(long elapsedTime)
           
 
Methods inherited from class moagg.model.object.sprite.AbstractMoaggAnimatedSprite
addSpeed, getPositionRectangle, getRGB, getSpeed, hide, isVisible, setRGB, setSpeed, setVisible, show
 
Methods inherited from class com.golden.gamedev.object.AnimatedSprite
getAnimationTimer, getFinishAnimationFrame, getFrame, getImage, getImage, getImages, getStartAnimationFrame, isAnimate, isLoopAnim, render, setAnimate, setAnimationFrame, setAnimationTimer, setFrame, setImage, setImages, setLoopAnim, updateAnimation
 
Methods inherited from class com.golden.gamedev.object.Sprite
addHorizontalSpeed, addVerticalSpeed, forceX, forceY, getBackground, getCenterX, getCenterY, getDataID, getDefaultCollisionShape, getDistance, getHeight, getHorizontalSpeed, getID, getLayer, getOldX, getOldY, getScreenX, getScreenY, getVerticalSpeed, getWidth, getX, getY, isActive, isImmutable, isOnScreen, isOnScreen, move, moveTo, moveX, moveY, render, setActive, setBackground, setDataID, setHorizontalSpeed, setID, setImmutable, setLayer, setLocation, setMovement, setSpeed, setVerticalSpeed, setX, setY, updateMovement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface moagg.model.object.MoaggGameObject
getHeight, getID, getPositionRectangle, getSpeed, getWidth, getX, getY, hide, isVisible, setID, setSpeed, setSpeed, setX, setY, show
 
Methods inherited from interface moagg.model.object.MoaggGameObject
getHeight, getID, getPositionRectangle, getSpeed, getWidth, getX, getY, hide, isVisible, setID, setSpeed, setSpeed, setX, setY, show
 
Methods inherited from interface moagg.model.object.MoaggGameObject
getHeight, getID, getPositionRectangle, getSpeed, getWidth, getX, getY, hide, isVisible, setID, setSpeed, setSpeed, setX, setY, show
 
Methods inherited from interface moagg.model.object.MoaggGameObject
getHeight, getID, getPositionRectangle, getSpeed, getWidth, getX, getY, hide, isVisible, setID, setSpeed, setSpeed, setX, setY, show
 
Methods inherited from interface moagg.model.object.MoaggGameObject
getHeight, getID, getPositionRectangle, getSpeed, getWidth, getX, getY, hide, isVisible, setID, setSpeed, setSpeed, setX, setY, show
 

Constructor Detail

Ship

public Ship()
Method Detail

getAngle

public double getAngle()
Specified by:
getAngle in interface ControllableObject

setAngle

public void setAngle(double angle)
Specified by:
setAngle in interface ControllableObject

isThrust

public boolean isThrust()
Specified by:
isThrust in interface ControllableObject

setThrust

public void setThrust(boolean thrust)
Specified by:
setThrust in interface ControllableObject

getThrustForce

public double getThrustForce()
Specified by:
getThrustForce in interface ControllableObject

setThrustForce

public void setThrustForce(double thrustForce)
Specified by:
setThrustForce in interface ControllableObject

getMass

public long getMass()
Specified by:
getMass in interface ControllableObject

setMass

public void setMass(long mass)
Specified by:
setMass in interface ControllableObject

getFuelCapacity

public long getFuelCapacity()
Specified by:
getFuelCapacity in interface ControllableObject

setFuelCapacity

public void setFuelCapacity(long fuelCapacity)
Specified by:
setFuelCapacity in interface ControllableObject

getFuel

public long getFuel()
Specified by:
getFuel in interface ControllableObject

setFuel

public void setFuel(long fuel)
Specified by:
setFuel in interface ControllableObject

getFuelPerMilliSecond

public long getFuelPerMilliSecond()
Specified by:
getFuelPerMilliSecond in interface ControllableObject

setFuelPerMilliSecond

public void setFuelPerMilliSecond(long fuelPerMilliSecond)
Specified by:
setFuelPerMilliSecond in interface ControllableObject

getRotation

public Rotation getRotation()
Specified by:
getRotation in interface ControllableObject

setRotation

public void setRotation(Rotation rotation)
Specified by:
setRotation in interface ControllableObject

isAligned

public boolean isAligned()
Specified by:
isAligned in interface ControllableObject

getRotationSpeed

public double getRotationSpeed()
Specified by:
getRotationSpeed in interface ControllableObject

setRotationSpeed

public void setRotationSpeed(double rotationSpeed)
Specified by:
setRotationSpeed in interface ControllableObject

isLanded

public boolean isLanded()
Specified by:
isLanded in interface LandableObject

setLandedPlatform

public void setLandedPlatform(Platform landedPlatform)

getLandedPlatform

public Platform getLandedPlatform()
Specified by:
getLandedPlatform in interface LandableObject

getLandingZone

public Rectangle getLandingZone()

getHealth

public int getHealth()
Specified by:
getHealth in interface DestroyableObject
Returns:
The current health points of this object.

setHealth

public void setHealth(int health)
Specified by:
setHealth in interface DestroyableObject
Parameters:
health - The new amount of health points to set for this object.

destroy

public void destroy()
Description copied from interface: DestroyableObject
Calling this method will initiate the destruction of this object.

Specified by:
destroy in interface DestroyableObject

getScorePoints

public int getScorePoints()
Specified by:
getScorePoints in interface DestroyableObject
Returns:
The points that shall be added to the player's score.

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()

setShipType

public void setShipType(int shipType)

getShipType

public int getShipType()

setWeapon

public void setWeapon(Weapon weapon)
Specified by:
setWeapon in interface ShooterObject

getWeapon

public Weapon getWeapon()
Specified by:
getWeapon in interface ShooterObject

hasCrates

public boolean hasCrates()

getCrates

public java.util.List<Crate> getCrates()

hasCapacityForCrate

public boolean hasCapacityForCrate(Crate crate)

hasCrate

public boolean hasCrate(Crate crate)

pickupCrate

public void pickupCrate(Crate crate)

dropCrate

public void dropCrate(Crate crate)

update

public void update(long elapsedTime)
Overrides:
update in class com.golden.gamedev.object.AnimatedSprite


Copyright © 2008. All Rights Reserved.