test_class.file: Space Battle Simulation/SpaceBattleSimulation/src/test/java/com/perceptivesoftware/codedash/simulation/SpaceBattleSimulationTest.java
test_class.identifier: SpaceBattleSimulationTest
test_case.body: @Test
  	public void battleTestEnemyWins() {
  		SpaceBattleSimulation sim = new SpaceBattleSimulation();
  		
  		List<SpaceBattleSimulation.Ship> friendly = new ArrayList<SpaceBattleSimulation.Ship>();
  		List<SpaceBattleSimulation.Ship> enemy = new ArrayList<SpaceBattleSimulation.Ship>();
  		
  		friendly.add(sim.new Dreadnaught());
  		friendly.add(sim.new PatrolVessel());
  		
  		enemy.add(sim.new Bomber());
  		enemy.add(sim.new Bomber());
  		enemy.add(sim.new Destroyer());
  		
  		boolean isVictory = SpaceBattleSimulation.battle(friendly, enemy);
  		
  		if(isVictory){
  			System.out.println("Friendly wins!");
  		}
  		else{
  			System.out.println("Enemy Wins!");
  		}
  		
  	}
test_case.class_method_signature: SpaceBattleSimulationTest.battleTestEnemyWins()
test_case.full_signature: @Test public void battleTestEnemyWins()
test_case.identifier: battleTestEnemyWins
test_case.invocations: add add add add add battle println println
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void battleTestEnemyWins()
focal_class.file: Space Battle Simulation/SpaceBattleSimulation/src/main/java/com/perceptivesoftware/codedash/simulation/SpaceBattleSimulation.java
focal_class.identifier: SpaceBattleSimulation
focal_class.class_method_signature: SpaceBattleSimulation.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_class.class_method_signature: SpaceBattleSimulation.convertInputToList(String commaDelem)
focal_class.full_signature: protected static List<Ship> convertInputToList(String commaDelem)
focal_class.identifier: convertInputToList
focal_class.modifiers: protected static
focal_class.parameters: (String commaDelem)
focal_class.return: List<Ship>
focal_class.signature: List<Ship> convertInputToList(String commaDelem)
focal_class.class_method_signature: SpaceBattleSimulation.mapAbbreviationToShip(String shipAbbreviation)
focal_class.full_signature: protected static Ship mapAbbreviationToShip(String shipAbbreviation)
focal_class.identifier: mapAbbreviationToShip
focal_class.modifiers: protected static
focal_class.parameters: (String shipAbbreviation)
focal_class.return: Ship
focal_class.signature: Ship mapAbbreviationToShip(String shipAbbreviation)
focal_class.class_method_signature: SpaceBattleSimulation.battle(List<Ship> friendly, List<Ship> enemy)
focal_class.full_signature: protected static boolean battle(List<Ship> friendly, List<Ship> enemy)
focal_class.identifier: battle
focal_class.modifiers: protected static
focal_class.parameters: (List<Ship> friendly, List<Ship> enemy)
focal_class.return: boolean
focal_class.signature: boolean battle(List<Ship> friendly, List<Ship> enemy)
focal_class.class_method_signature: SpaceBattleSimulation.engagement(Ship enemy, Ship friend)
focal_class.full_signature: public static void engagement(Ship enemy, Ship friend)
focal_class.identifier: engagement
focal_class.modifiers: public static
focal_class.parameters: (Ship enemy, Ship friend)
focal_class.return: void
focal_class.signature: void engagement(Ship enemy, Ship friend)
focal_method.body: protected static boolean battle(List<Ship> friendly, List<Ship> enemy){
  		
  		Ship friendlyShip = friendly.remove(0);
  		Ship enemyShip = enemy.remove(0);
  		
  		int friendlyFleetSize = friendly.size() + 1;
  		int enemyFleetSize = enemy.size() + 1;
  		
  		while(friendlyFleetSize > 0 && enemyFleetSize > 0){
  			engagement(enemyShip, friendlyShip);
  
  			if(friendlyShip.isDestroyed){
  				if(friendly.size() > 0){
  					friendlyShip = friendly.remove(0);
  				}
  				--friendlyFleetSize;
  			}
  			
  			if(enemyShip.isDestroyed){
  				if(enemy.size() > 0){
  					enemyShip = enemy.remove(0);
  				}
  				--enemyFleetSize;
  			}
  			
  		}
  
          return friendlyFleetSize > 0 && enemyFleetSize == 0;
  			
  		
  	}
focal_method.class_method_signature: SpaceBattleSimulation.battle(List<Ship> friendly, List<Ship> enemy)
focal_method.full_signature: protected static boolean battle(List<Ship> friendly, List<Ship> enemy)
focal_method.identifier: battle
focal_method.invocations: remove remove size size engagement size remove size remove
focal_method.modifiers: protected static
focal_method.parameters: (List<Ship> friendly, List<Ship> enemy)
focal_method.return: boolean
focal_method.signature: boolean battle(List<Ship> friendly, List<Ship> enemy)