games.strategy.triplea.delegate
Class NonFightingBattle

java.lang.Object
  extended by games.strategy.triplea.delegate.NonFightingBattle

public class NonFightingBattle
extends java.lang.Object

Battle in which no fighting occurs. Example is a naval invasion into an empty country, but the battle cannot be fought until a naval battle occurs.

Version:
1.0
Author:
Sean Bridges
See Also:
Serialized Form

Constructor Summary
NonFightingBattle(Territory battleSite, PlayerID attacker, BattleTracker battleTracker, boolean neutral, GameData data)
           
 
Method Summary
 Change addAttackChange(Route route, java.util.Collection<Unit> units)
          Add a bunch of attacking units to the battle.
 void addBombardingUnit(Unit unit)
          Add bombarding unit.
 boolean equals(java.lang.Object o)
           
 void fight(IDelegateBridge bridge)
          Fight this battle.
 java.util.Collection<Unit> getAmphibiousLandAttackers()
          Return units which are actually assaulting amphibiously
 int getBattleRound()
           
 java.util.Collection<Unit> getBombardingUnits()
          Return units which are actually bombarding
 java.util.Collection<Unit> getDependentUnits(java.util.Collection units)
          Return units which are dependent on the given units.
 Territory getTerritory()
          Return what territory this battle is occuring in.
 int hashCode()
           
 boolean isAmphibious()
          Return whether battle is amphibious.
 boolean isBombingRun()
          Return whether this battle is a bombing run.
 boolean isEmpty()
          After an attack has been removed, you can use this to test if there are still units left to fight
 boolean isOver()
          Return whether this battle is over or not.
 void removeAttack(Route route, java.util.Collection<Unit> units)
          This occurs when a move has been undone
 void unitsLostInPrecedingBattle(games.strategy.triplea.delegate.Battle battle, java.util.Collection<Unit> units, IDelegateBridge bridge)
          Call this method when units are lost in another battle.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonFightingBattle

public NonFightingBattle(Territory battleSite,
                         PlayerID attacker,
                         BattleTracker battleTracker,
                         boolean neutral,
                         GameData data)
Method Detail

fight

public void fight(IDelegateBridge bridge)
Fight this battle.


isOver

public boolean isOver()
Return whether this battle is over or not.


isBombingRun

public boolean isBombingRun()
Return whether this battle is a bombing run.


removeAttack

public void removeAttack(Route route,
                         java.util.Collection<Unit> units)
This occurs when a move has been undone


isEmpty

public boolean isEmpty()
After an attack has been removed, you can use this to test if there are still units left to fight


addAttackChange

public Change addAttackChange(Route route,
                              java.util.Collection<Unit> units)
Add a bunch of attacking units to the battle.


getTerritory

public Territory getTerritory()
Return what territory this battle is occuring in.


unitsLostInPrecedingBattle

public void unitsLostInPrecedingBattle(games.strategy.triplea.delegate.Battle battle,
                                       java.util.Collection<Unit> units,
                                       IDelegateBridge bridge)
Call this method when units are lost in another battle. This is needed to remove dependent units who have been lost in another battle.


getDependentUnits

public java.util.Collection<Unit> getDependentUnits(java.util.Collection units)
Return units which are dependent on the given units.


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

addBombardingUnit

public void addBombardingUnit(Unit unit)
Add bombarding unit. Doesn't make sense here so just do nothing.


isAmphibious

public boolean isAmphibious()
Return whether battle is amphibious.


getAmphibiousLandAttackers

public java.util.Collection<Unit> getAmphibiousLandAttackers()
Return units which are actually assaulting amphibiously


getBombardingUnits

public java.util.Collection<Unit> getBombardingUnits()
Return units which are actually bombarding


getBattleRound

public int getBattleRound()