rl.leviathan.game
Class LeviathanGameTurn

java.lang.Object
  extended by rl.leviathan.game.LeviathanGameTurn
All Implemented Interfaces:
LeviathanFiringRoundListener, LeviathanMovementRoundListener, LeviathanPointDefenceRoundListener, LeviathanPowerAllocationListener

public class LeviathanGameTurn
extends java.lang.Object
implements LeviathanPowerAllocationListener, LeviathanMovementRoundListener, LeviathanFiringRoundListener, LeviathanPointDefenceRoundListener


Nested Class Summary
static class LeviathanGameTurn.CombatPhase
           
static class LeviathanGameTurn.EndPhase
           
static class LeviathanGameTurn.InitiativePhase
           
static class LeviathanGameTurn.MovementPhase
           
static class LeviathanGameTurn.PowerAllocationPhase
           
static class LeviathanGameTurn.TurnPhase
           
 
Constructor Summary
LeviathanGameTurn(int turnNumber, LeviathanGameSide sideOne, LeviathanGameSide sideTwo, LeviathanElementVisibility elementVisibility, LeviathanBoard board)
           
 
Method Summary
 void addListener(LeviathanGameTurnListener l)
           
 void completePowerAllocation(Player p)
           
 void completeTurn()
           
 void elementCompletedFiring(GameElementIdentifier element)
           
 void elementCompletedPointDefence(GameElementIdentifier element)
           
 void elementFiring(GameElementIdentifier element, GameElementIdentifier target, Coordinate sourceCoord, Coordinate targetCoord)
           
 void elementFiringComplete(GameElementIdentifier element, boolean roundComplete)
           
 void elementFiringPointDefence(GameElementIdentifier element, GameElementIdentifier target, Coordinate sourceCoord, Coordinate targetCoord)
           
 void elementFiringPointDefenceComplete(GameElementIdentifier element, boolean roundComplete)
           
 void elementSelectionRequired(LeviathanGameSide side, java.util.Vector<GameElementIdentifier> list)
           
 void elementsEligibleToFire(Player p, java.util.Vector<GameElementIdentifier> list)
           
 void elementsEligibleToFirePointDefence(Player p, java.util.Vector<GameElementIdentifier> list)
           
 void elementsRequiredToMove(Player p, java.util.Vector<GameElementIdentifier> elements)
           
 void elementToMove(Player p, GameElementIdentifier element)
           
 void elementTypeMoving(LeviathanMovementRound.ElementType type)
           
 void fighterUnitElementsEligibleToFire(Player p, java.util.Vector<GameElementIdentifier> list)
           
 void fighterUnitFireRoundCompleted()
           
 void fighterUnitFiringPhaseCompleted()
           
 void firingPhaseCompleted()
           
 void firingRoundCompleted()
           
 void gameElementMoved(GameElement e, Location l)
           
 LeviathanFiringRound getCurrentFiringRound()
           
 LeviathanMovementRound getCurrentMovementRound()
           
 LeviathanPointDefenceRound getCurrentPointDefenceRound()
           
 java.lang.String getPhase()
           
 java.lang.String getSubPhase()
           
 int getTurnNumber()
           
 boolean isTurnComplete()
           
 void movementPhaseCompleted()
           
 void movementRoundCompleted()
           
 void orderFireAttempt(FiringAttemptPacket packet)
           
 void orderPointDefenceAttempt(PointDefenceAttemptPacket packet)
           
 void pointDefencePhaseCompleted()
           
 void pointDefenceRoundCompleted()
           
 void powerAllocationCompleted()
           
 void powerAllocationRequired(Player p, java.util.Vector<GameElementIdentifier> elements)
           
 void powerAllocationSet(Player p, CapitalShipPowerAllocation cspa)
           
 void removeCapitalShipMissileElements()
           
 void removeListener(LeviathanGameTurnListener l)
           
protected  void resolveCapitalShipMovementOrders(CapitalShip cs, MovementOrderSequence mos)
           
 void resolveGameElementMovementOrders(MovementOrderSequence mos)
           
protected  boolean scrollMap(Location l, java.util.Vector<Location> locations)
           
 void setMovementTeamOrder(java.lang.String teamName)
           
 void setPowerAllocation(CapitalShipPowerAllocation cspa)
           
 void startTurn()
           
 void teamAMovementRoundComplete()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeviathanGameTurn

public LeviathanGameTurn(int turnNumber,
                         LeviathanGameSide sideOne,
                         LeviathanGameSide sideTwo,
                         LeviathanElementVisibility elementVisibility,
                         LeviathanBoard board)
Method Detail

addListener

public void addListener(LeviathanGameTurnListener l)

removeListener

public void removeListener(LeviathanGameTurnListener l)

getTurnNumber

public int getTurnNumber()

getPhase

public java.lang.String getPhase()

getSubPhase

public java.lang.String getSubPhase()

getCurrentMovementRound

public LeviathanMovementRound getCurrentMovementRound()

isTurnComplete

public boolean isTurnComplete()

startTurn

public void startTurn()

completeTurn

public void completeTurn()

setMovementTeamOrder

public void setMovementTeamOrder(java.lang.String teamName)

setPowerAllocation

public void setPowerAllocation(CapitalShipPowerAllocation cspa)

completePowerAllocation

public void completePowerAllocation(Player p)

powerAllocationRequired

public void powerAllocationRequired(Player p,
                                    java.util.Vector<GameElementIdentifier> elements)
Specified by:
powerAllocationRequired in interface LeviathanPowerAllocationListener

powerAllocationSet

public void powerAllocationSet(Player p,
                               CapitalShipPowerAllocation cspa)
Specified by:
powerAllocationSet in interface LeviathanPowerAllocationListener

powerAllocationCompleted

public void powerAllocationCompleted()
Specified by:
powerAllocationCompleted in interface LeviathanPowerAllocationListener

elementSelectionRequired

public void elementSelectionRequired(LeviathanGameSide side,
                                     java.util.Vector<GameElementIdentifier> list)
Specified by:
elementSelectionRequired in interface LeviathanMovementRoundListener

elementsRequiredToMove

public void elementsRequiredToMove(Player p,
                                   java.util.Vector<GameElementIdentifier> elements)

elementToMove

public void elementToMove(Player p,
                          GameElementIdentifier element)
Specified by:
elementToMove in interface LeviathanMovementRoundListener

teamAMovementRoundComplete

public void teamAMovementRoundComplete()
Specified by:
teamAMovementRoundComplete in interface LeviathanMovementRoundListener

movementRoundCompleted

public void movementRoundCompleted()
Specified by:
movementRoundCompleted in interface LeviathanMovementRoundListener

movementPhaseCompleted

public void movementPhaseCompleted()
Specified by:
movementPhaseCompleted in interface LeviathanMovementRoundListener

elementTypeMoving

public void elementTypeMoving(LeviathanMovementRound.ElementType type)
Specified by:
elementTypeMoving in interface LeviathanMovementRoundListener

gameElementMoved

public void gameElementMoved(GameElement e,
                             Location l)

getCurrentFiringRound

public LeviathanFiringRound getCurrentFiringRound()

elementsEligibleToFire

public void elementsEligibleToFire(Player p,
                                   java.util.Vector<GameElementIdentifier> list)
Specified by:
elementsEligibleToFire in interface LeviathanFiringRoundListener

firingRoundCompleted

public void firingRoundCompleted()
Specified by:
firingRoundCompleted in interface LeviathanFiringRoundListener

firingPhaseCompleted

public void firingPhaseCompleted()
Specified by:
firingPhaseCompleted in interface LeviathanFiringRoundListener

getCurrentPointDefenceRound

public LeviathanPointDefenceRound getCurrentPointDefenceRound()

elementsEligibleToFirePointDefence

public void elementsEligibleToFirePointDefence(Player p,
                                               java.util.Vector<GameElementIdentifier> list)
Specified by:
elementsEligibleToFirePointDefence in interface LeviathanPointDefenceRoundListener

pointDefenceRoundCompleted

public void pointDefenceRoundCompleted()
Specified by:
pointDefenceRoundCompleted in interface LeviathanPointDefenceRoundListener

pointDefencePhaseCompleted

public void pointDefencePhaseCompleted()
Specified by:
pointDefencePhaseCompleted in interface LeviathanPointDefenceRoundListener

fighterUnitElementsEligibleToFire

public void fighterUnitElementsEligibleToFire(Player p,
                                              java.util.Vector<GameElementIdentifier> list)

fighterUnitFireRoundCompleted

public void fighterUnitFireRoundCompleted()

fighterUnitFiringPhaseCompleted

public void fighterUnitFiringPhaseCompleted()

orderFireAttempt

public void orderFireAttempt(FiringAttemptPacket packet)

elementCompletedFiring

public void elementCompletedFiring(GameElementIdentifier element)

orderPointDefenceAttempt

public void orderPointDefenceAttempt(PointDefenceAttemptPacket packet)

elementCompletedPointDefence

public void elementCompletedPointDefence(GameElementIdentifier element)

elementFiring

public void elementFiring(GameElementIdentifier element,
                          GameElementIdentifier target,
                          Coordinate sourceCoord,
                          Coordinate targetCoord)
Specified by:
elementFiring in interface LeviathanFiringRoundListener

elementFiringComplete

public void elementFiringComplete(GameElementIdentifier element,
                                  boolean roundComplete)
Specified by:
elementFiringComplete in interface LeviathanFiringRoundListener

elementFiringPointDefence

public void elementFiringPointDefence(GameElementIdentifier element,
                                      GameElementIdentifier target,
                                      Coordinate sourceCoord,
                                      Coordinate targetCoord)
Specified by:
elementFiringPointDefence in interface LeviathanPointDefenceRoundListener

elementFiringPointDefenceComplete

public void elementFiringPointDefenceComplete(GameElementIdentifier element,
                                              boolean roundComplete)
Specified by:
elementFiringPointDefenceComplete in interface LeviathanPointDefenceRoundListener

removeCapitalShipMissileElements

public void removeCapitalShipMissileElements()

resolveGameElementMovementOrders

public void resolveGameElementMovementOrders(MovementOrderSequence mos)

resolveCapitalShipMovementOrders

protected void resolveCapitalShipMovementOrders(CapitalShip cs,
                                                MovementOrderSequence mos)

scrollMap

protected boolean scrollMap(Location l,
                            java.util.Vector<Location> locations)