spacewar
Class Ship

java.lang.Object
  |
  +--spacewar.SpaceObject
        |
        +--spacewar.Ship

class Ship
extends SpaceObject


Pointcut Summary
helmCommandsCut(Ship)
 

 
Field Summary
(package private) static int BULLET_SPEED
          
(package private) static int CLOCKWISE
          
(package private) static int COUNTERCLOCKWISE
          
(package private) static double DEFAULT_ACCELERATION
          
(package private) static double DEFAULT_ANGULAR_VELOCITY
          
(package private) static int MAX_DAMAGE
          
(package private) static int STOP
          
 
Constructor Summary
(package private) Ship(Game theGame, double xPos, double yPos, double orientation)
          
Advised by: spacewar.Display1.ShipDA, spacewar.Display2.ShipDA
 
Method Summary
(package private) static void bounce(Ship shipA, Ship shipB)
          
 void clockTick()
          
(package private)  boolean expendEnergy(double amount)
          
(package private)  void fire()
          
Advised by: spacewar.EnsureShipIsAlive
(package private)  double getDamage()
          
(package private)  float getDamageLevel()
          
(package private)  double getEnergy()
          
(package private)  float getEnergyLevel()
          
(package private)  double getOrientation()
          
(package private)  Pilot getPilot()
          
(package private)  double getRAcc()
          
(package private)  int getSize()
          
(package private)  void handleCollision(SpaceObject obj)
          
(package private)  void inflictDamage(double amount)
          
(package private)  void repairDamage(double amount)
          
(package private)  void rotate(int direction)
          
Advised by: spacewar.EnsureShipIsAlive
(package private)  void setAcceleration(double acc)
           First check to make sure we have enough energy to accelerate.
(package private)  void setAngularVelocity(double omega)
          
(package private)  void setPilot(Pilot p)
          
(package private)  void stop()
          
Advised by: spacewar.EnsureShipIsAlive
(package private)  void thrust(boolean onOff)
          
Advised by: spacewar.EnsureShipIsAlive
 
Methods inherited from class spacewar.SpaceObject
, accelerate, die, getGame, getOldXPos, getOldYPos, getXPos, getXVel, getYPos, getYVel, isAlive, setIsAlive, setXVel, setYVel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

 
Crosscut Detail

helmCommandsCut(Ship)

Field Detail

MAX_DAMAGE

static final int MAX_DAMAGE

BULLET_SPEED

static final int BULLET_SPEED

CLOCKWISE

static final int CLOCKWISE

STOP

static final int STOP

COUNTERCLOCKWISE

static final int COUNTERCLOCKWISE

DEFAULT_ANGULAR_VELOCITY

static final double DEFAULT_ANGULAR_VELOCITY

DEFAULT_ACCELERATION

static final double DEFAULT_ACCELERATION
Constructor Detail

Ship

Ship(Game theGame,
     double xPos,
     double yPos,
     double orientation)

Advised by: spacewar.Display1.ShipDA, spacewar.Display2.ShipDA
Method Detail

getSize

int getSize()
Overrides:
getSize in class SpaceObject

getEnergy

double getEnergy()

getDamage

double getDamage()

getOrientation

double getOrientation()

getRAcc

double getRAcc()

getPilot

Pilot getPilot()

setPilot

void setPilot(Pilot p)

getEnergyLevel

float getEnergyLevel()

getDamageLevel

float getDamageLevel()

expendEnergy

boolean expendEnergy(double amount)

inflictDamage

void inflictDamage(double amount)

repairDamage

void repairDamage(double amount)

clockTick

public void clockTick()
Overrides:
clockTick in class SpaceObject

setAcceleration

void setAcceleration(double acc)
First check to make sure we have enough energy to accelerate. If we do, then go ahead and do so. Acceleration is in the direction we are already facing (i.e. orientation).

setAngularVelocity

void setAngularVelocity(double omega)

rotate

void rotate(int direction)

Advised by: spacewar.EnsureShipIsAlive

thrust

void thrust(boolean onOff)

Advised by: spacewar.EnsureShipIsAlive

fire

void fire()

Advised by: spacewar.EnsureShipIsAlive

stop

void stop()

Advised by: spacewar.EnsureShipIsAlive

handleCollision

void handleCollision(SpaceObject obj)
Overrides:
handleCollision in class SpaceObject

bounce

static void bounce(Ship shipA,
                   Ship shipB)