rl.common.game.elements
Class VehicleCrew

java.lang.Object
  extended by rl.common.game.elements.GameElement
      extended by rl.common.game.elements.VehicleCrew
All Implemented Interfaces:
java.io.Serializable, MovementCapableElement

public class VehicleCrew
extends GameElement
implements MovementCapableElement

See Also:
Serialized Form

Nested Class Summary
static class VehicleCrew.Status
           
 
Nested classes/interfaces inherited from class rl.common.game.elements.GameElement
GameElement.StatusPhase
 
Field Summary
(package private) static long serialVersionUID
           
static java.lang.String[] StatusNames
           
 
Constructor Summary
VehicleCrew()
           
 
Method Summary
 void applyDamageSummary(GameElementDamageSummary geds)
           
 void applyMovementSummary(GameElementMovementSummary gems)
          applies the summary of movement to the element.
 GameElementDamageSummary calculateStatus(int turn, GameElement.StatusPhase phase)
           
 boolean canFire()
           
 boolean canMove()
           
 boolean canMove(int turn)
          returns whether the element can move in a given turn
 VehicleCrew.Status getCommanderStatus()
           
 double getDamageSummary(int turn)
           
 int getDriverRating()
           
 VehicleCrew.Status getDriverStatus()
           
 java.lang.String getElementType()
           
 VehicleCrew.Status getGunnerStatus()
           
 int getGunneryRating()
           
 double getInternalDamageSummary(int turn)
           
 GameElementMovementSummary getMovementSummary(int turn)
          return a new GameElementMovementSummary appropriate for the element implementing this interface
 java.lang.String getName()
           
 boolean hasInternalStructure()
           
 boolean hasMoved(int turn)
          returns whether a unit has moved in a given turn
 boolean isDestroyed(int turn)
           
 boolean isGravElement()
           
 void setCommanderStatus(VehicleCrew.Status status)
           
 void setDriverRating(int rating)
           
 void setDriverStatus(VehicleCrew.Status status)
           
 void setGunnerStatus(VehicleCrew.Status status)
           
 void setGunneryRating(int rating)
           
 void setMoved(int turn)
          sets the status of an element that has moved in a given turn
 void setName(java.lang.String name)
           
 
Methods inherited from class rl.common.game.elements.GameElement
equals, getID, getIdentifier, getUnit, hashCode, setUnit, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

StatusNames

public static final java.lang.String[] StatusNames
Constructor Detail

VehicleCrew

public VehicleCrew()
Method Detail

isGravElement

public boolean isGravElement()

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()
Specified by:
getName in class GameElement

getCommanderStatus

public VehicleCrew.Status getCommanderStatus()

setCommanderStatus

public void setCommanderStatus(VehicleCrew.Status status)

getDriverStatus

public VehicleCrew.Status getDriverStatus()

setDriverStatus

public void setDriverStatus(VehicleCrew.Status status)

getGunnerStatus

public VehicleCrew.Status getGunnerStatus()

setGunnerStatus

public void setGunnerStatus(VehicleCrew.Status status)

getElementType

public java.lang.String getElementType()
Specified by:
getElementType in class GameElement

getDriverRating

public int getDriverRating()

setDriverRating

public void setDriverRating(int rating)

getGunneryRating

public int getGunneryRating()

setGunneryRating

public void setGunneryRating(int rating)

calculateStatus

public GameElementDamageSummary calculateStatus(int turn,
                                                GameElement.StatusPhase phase)
Specified by:
calculateStatus in class GameElement

applyDamageSummary

public void applyDamageSummary(GameElementDamageSummary geds)
Specified by:
applyDamageSummary in class GameElement

canMove

public boolean canMove()

canFire

public boolean canFire()

isDestroyed

public boolean isDestroyed(int turn)
Specified by:
isDestroyed in class GameElement

hasInternalStructure

public boolean hasInternalStructure()
Specified by:
hasInternalStructure in class GameElement

getDamageSummary

public double getDamageSummary(int turn)
Specified by:
getDamageSummary in class GameElement

getInternalDamageSummary

public double getInternalDamageSummary(int turn)
Specified by:
getInternalDamageSummary in class GameElement

canMove

public boolean canMove(int turn)
Description copied from interface: MovementCapableElement
returns whether the element can move in a given turn

Specified by:
canMove in interface MovementCapableElement
Returns:
whether the element is capable of being moved on the turn supplied

hasMoved

public boolean hasMoved(int turn)
Description copied from interface: MovementCapableElement
returns whether a unit has moved in a given turn

Specified by:
hasMoved in interface MovementCapableElement
Returns:
if the element has moved on the turn supplied

setMoved

public void setMoved(int turn)
Description copied from interface: MovementCapableElement
sets the status of an element that has moved in a given turn

Specified by:
setMoved in interface MovementCapableElement

getMovementSummary

public GameElementMovementSummary getMovementSummary(int turn)
Description copied from interface: MovementCapableElement
return a new GameElementMovementSummary appropriate for the element implementing this interface

Specified by:
getMovementSummary in interface MovementCapableElement

applyMovementSummary

public void applyMovementSummary(GameElementMovementSummary gems)
Description copied from interface: MovementCapableElement
applies the summary of movement to the element. This is to provide a synch between the element on the server and the one on the client.

Specified by:
applyMovementSummary in interface MovementCapableElement