game.units
Class Unit

java.lang.Object
  extended bygame.physics.Body
      extended bygame.physics.MovingBody
          extended bygame.units.Unit
Direct Known Subclasses:
Ship

public class Unit
extends MovingBody


Field Summary
static double CLOAK_RADAR_FACTOR
           
static boolean printDamage
           
 
Constructor Summary
Unit(java.lang.String name, java.lang.String file, java.lang.String type, Hull hull, int playerID, double radius, double mass, double maxSpeed, double acceleration, double maxAngularVelocity, double angularAcceleration)
           
 
Method Summary
 boolean canSee(Body b)
           
 void collide(Unit unit)
           
 DefaultController getController()
           
 int getHealth()
           
 Hull getHull()
           
 java.awt.Image getIconImage()
           
 int getMode()
           
 java.lang.String getName()
           
 double getRadarRange()
           
 java.lang.String getType()
           
 boolean integrate(double timestep, double density)
           
 boolean isCapital()
           
 boolean isCloakable()
           
 boolean isDead()
           
 void setCloakable(boolean isCloakable)
           
 void setController(DefaultController controller)
           
 void setName(java.lang.String name)
           
 void stopMissile(Projectile p, double timestep)
           
 void takeDamage(Body source, double damage)
           
 void toggleCloak()
           
 void toggleWeaponsFree()
           
 java.lang.String toString()
           
 
Methods inherited from class game.physics.MovingBody
applyForce, collide, getDensityEffect, getMaxAngularVelocity, getMaxSpeed, getVelocity, integrate, predictPosition, predictVelocity, reportMotionStatus, setTargetHeading, setTargetVelocity, setVelocity
 
Methods inherited from class game.physics.Body
findBearing, findHeading, findHeading, getBounds, getColor, getHeading, getPlayer, getPlayerID, getPosition, init, init, isColliding, normalize, setHeading, setPosition, setPosition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLOAK_RADAR_FACTOR

public static final double CLOAK_RADAR_FACTOR
See Also:
Constant Field Values

printDamage

public static final boolean printDamage
See Also:
Constant Field Values
Constructor Detail

Unit

public Unit(java.lang.String name,
            java.lang.String file,
            java.lang.String type,
            Hull hull,
            int playerID,
            double radius,
            double mass,
            double maxSpeed,
            double acceleration,
            double maxAngularVelocity,
            double angularAcceleration)
Method Detail

setController

public void setController(DefaultController controller)

toggleWeaponsFree

public void toggleWeaponsFree()

takeDamage

public void takeDamage(Body source,
                       double damage)

canSee

public boolean canSee(Body b)

stopMissile

public void stopMissile(Projectile p,
                        double timestep)

isDead

public boolean isDead()
Specified by:
isDead in class Body
See Also:
Body.isDead()

collide

public void collide(Unit unit)

integrate

public boolean integrate(double timestep,
                         double density)
Overrides:
integrate in class MovingBody
See Also:
MovingBody.integrate(double, double)

isCapital

public boolean isCapital()

toString

public java.lang.String toString()
See Also:
Object.toString()

getIconImage

public java.awt.Image getIconImage()

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getMode

public int getMode()

getHull

public Hull getHull()

getHealth

public int getHealth()

getController

public DefaultController getController()

getType

public java.lang.String getType()

getRadarRange

public double getRadarRange()

isCloakable

public boolean isCloakable()

setCloakable

public void setCloakable(boolean isCloakable)

toggleCloak

public void toggleCloak()