rl.centurion.game
Class PointDefenceAllocation

java.lang.Object
  extended by rl.centurion.game.PointDefenceAllocation
All Implemented Interfaces:
java.io.Serializable

public class PointDefenceAllocation
extends java.lang.Object
implements java.io.Serializable

This class encapsulates any point defence allocation against missile attacks. It is written to handle a vehicle having more than one point defence system even though none of the default vehicles in the game carries any more than one.

See Also:
Serialized Form

Nested Class Summary
 class PointDefenceAllocation.PointDefenceSystem
           
 
Field Summary
(package private) static long serialVersionUID
           
 
Constructor Summary
PointDefenceAllocation(GameElementIdentifier source, GameElementIdentifier target, java.util.Vector<EquipmentMount> systems, java.util.Vector<java.lang.String> attacks, int additionalAttacks)
           
 
Method Summary
 void allocateShots(int systemIndex, int shots)
           
 boolean areShotsAllocated()
           
 int getAdditionalAttacks()
           
 java.util.Vector<java.lang.String> getMissileAttacks()
           
 PointDefenceAllocation.PointDefenceSystem getPointDefenceSystem(int index)
           
 int getPointDefenceSystemCount()
           
 int getShotsAllocated()
           
 int getShotsRemaining()
           
 GameElementIdentifier getSource()
           
 GameElementIdentifier getTarget()
           
 void setAdditionalAttacks(int additionalAttacks)
           
 void setMissileAttacks(java.util.Vector<java.lang.String> attacks)
           
 boolean shotSpecifiedForAttack(int index)
           
 void specifyShot(int systemIndex, int shotIndex)
           
 PointDefenceAllocation.PointDefenceSystem systemSpecifiedForAttack(int index)
           
 void unspecifyShot(int systemIndex, int shotIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

PointDefenceAllocation

public PointDefenceAllocation(GameElementIdentifier source,
                              GameElementIdentifier target,
                              java.util.Vector<EquipmentMount> systems,
                              java.util.Vector<java.lang.String> attacks,
                              int additionalAttacks)
Parameters:
source - The identifier of the element the missile attack originated from
target - The identifier of the target of the missile attack
systems - A List of the Point Defense systems on the target
attacks - A List of the missiles that have successfully attacked the target
additionalAttacks - A count of the attacks aimed that the target that are yet to be resolved in this combat phase
Method Detail

getSource

public GameElementIdentifier getSource()

getTarget

public GameElementIdentifier getTarget()

getAdditionalAttacks

public int getAdditionalAttacks()

getShotsAllocated

public int getShotsAllocated()

getShotsRemaining

public int getShotsRemaining()

areShotsAllocated

public boolean areShotsAllocated()

getPointDefenceSystemCount

public int getPointDefenceSystemCount()

getPointDefenceSystem

public PointDefenceAllocation.PointDefenceSystem getPointDefenceSystem(int index)

getMissileAttacks

public java.util.Vector<java.lang.String> getMissileAttacks()

setMissileAttacks

public void setMissileAttacks(java.util.Vector<java.lang.String> attacks)

setAdditionalAttacks

public void setAdditionalAttacks(int additionalAttacks)

shotSpecifiedForAttack

public boolean shotSpecifiedForAttack(int index)

systemSpecifiedForAttack

public PointDefenceAllocation.PointDefenceSystem systemSpecifiedForAttack(int index)

allocateShots

public void allocateShots(int systemIndex,
                          int shots)

specifyShot

public void specifyShot(int systemIndex,
                        int shotIndex)

unspecifyShot

public void unspecifyShot(int systemIndex,
                          int shotIndex)