Source:
public static void setPlayerDeploymentTurns(AtBDynamicScenario scenario, Campaign campaign) { int strategy = scenario.getLanceCommanderSkill(SkillType.S_STRATEGY, campaign); for(int forceID : scenario.getForceIDs()) { ScenarioForceTemplate forceTemplate = scenario.getPlayerForceTemplates().get(forceID); List<Entity> forceEntities = new ArrayList<>(); Force playerForce = campaign.getForce(forceID); for(UUID unitID : playerForce.getAllUnits()) { Unit currentUnit = campaign.getUnit(unitID); if(currentUnit != null) { forceEntities.add(currentUnit.getEntity()); } } if(forceTemplate != null) { int deployRound = forceTemplate.getArrivalTurn(); if(deployRound == ScenarioForceTemplate.ARRIVAL_TURN_STAGGERED_BY_LANCE) { setDeploymentTurnsStaggeredByLance(forceEntities); } else if (deployRound == ScenarioForceTemplate.ARRIVAL_TURN_AS_REINFORCEMENTS) { setDeploymentTurnsForReinforcements(forceEntities, strategy); } else { for(Entity entity : forceEntities) { entity.setDeployRound(deployRound); } } } else { setDeploymentTurnsForReinforcements(forceEntities, strategy); } } for(UUID unitID : scenario.getIndividualUnitIDs()) { ScenarioForceTemplate forceTemplate = scenario.getPlayerUnitTemplates().get(unitID); Entity entity = campaign.getUnit(unitID).getEntity(); if(forceTemplate != null) { int deployRound = forceTemplate.getArrivalTurn(); if(deployRound == ScenarioForceTemplate.ARRIVAL_TURN_STAGGERED_BY_LANCE) { setDeploymentTurnsStaggeredByLance(Arrays.asList(entity)); } else if (deployRound == ScenarioForceTemplate.ARRIVAL_TURN_AS_REINFORCEMENTS) { setDeploymentTurnsForReinforcements(Arrays.asList(entity), strategy); } else { entity.setDeployRound(deployRound); } } else { setDeploymentTurnsForReinforcements(Arrays.asList(entity), strategy); } } }

Target:
public static void setPlayerDeploymentTurns(AtBDynamicScenario scenario, Campaign campaign) { int strategy = scenario.getLanceCommanderSkill(SkillType.S_STRATEGY, campaign); for(int forceID : scenario.getForceIDs()) { ScenarioForceTemplate forceTemplate = scenario.getPlayerForceTemplates().get(forceID); List<Entity> forceEntities = new ArrayList<>(); Force playerForce = campaign.getForce(forceID); for(UUID unitID : playerForce.getAllUnits()) { Unit currentUnit = campaign.getUnit(unitID); if(currentUnit != null) { forceEntities.add(currentUnit.getEntity()); } } if(forceTemplate != null) { int deployRound = forceTemplate.getArrivalTurn(); if(deployRound == ScenarioForceTemplate.ARRIVAL_TURN_STAGGERED_BY_LANCE) { setDeploymentTurnsStaggeredByLance(forceEntities); } else if (deployRound == ScenarioForceTemplate.ARRIVAL_TURN_AS_REINFORCEMENTS) { setDeploymentTurnsForReinforcements(forceEntities, strategy); } else { for(Entity entity : forceEntities) { entity.setDeployRound(deployRound); } } } else { setDeploymentTurnsForReinforcements(forceEntities, strategy); } } for(UUID unitID : scenario.getIndividualUnitIDs()) { ScenarioForceTemplate forceTemplate = scenario.getPlayerUnitTemplates().get(unitID); Entity entity = campaign.getUnit(unitID).getEntity(); if(forceTemplate != null) { int deployRound = forceTemplate.getArrivalTurn(); if(deployRound == ScenarioForceTemplate.ARRIVAL_TURN_STAGGERED_BY_LANCE) { setDeploymentTurnsStaggeredByLance(Collections.singletonList(entity)); } else if (deployRound == ScenarioForceTemplate.ARRIVAL_TURN_AS_REINFORCEMENTS) { setDeploymentTurnsForReinforcements(Collections.singletonList(entity), strategy); } else { entity.setDeployRound(deployRound); } } else { setDeploymentTurnsForReinforcements(Arrays.asList(entity), strategy); } } }