class SpaceBattleSimulation {

	public static void engagement(Ship enemy, Ship friend){
		while(!enemy.isDestroyed && friend.isDestroyed == false){
			//Friendly attacks enemy
			int friendAtkVal = friend.attack((Class<Ship>) enemy.getClass());
			enemy.attacked(friendAtkVal);
			
			//Enemy attacks Friendly
			int enemyAttackVal = enemy.attack((Class<Ship>) friend.getClass());
			friend.attacked(enemyAttackVal);
			
		}
	}

}