/// <remarks>Calculates a good plan to break the territory with minimal deployment. Returns null if no solution was found. /// </remarks> /// <param name="opponentTerritory"></param> /// <param name="maxDeployment"></param> /// <returns></returns> public Moves CalculateBreakTerritoryTask(BotTerritory opponentTerritory, int maxDeployment, BotTerritory.DeploymentType lowerConservativeLevel, BotTerritory.DeploymentType upperConservativeLevel, string source) { var outvar = new Moves(); var lowestBoundDeployment = opponentTerritory.GetArmiesAfterDeployment(lowerConservativeLevel).NumArmies; var uppestBoundDeployment = opponentTerritory.GetArmiesAfterDeployment(upperConservativeLevel).NumArmies; for (var deployment = lowestBoundDeployment; deployment <= uppestBoundDeployment; deployment++) { var solution = CalculateBreakTerritoryMoves(opponentTerritory, maxDeployment, deployment, source); if (solution == null) { return(outvar); } else { outvar = solution; } } return(outvar); }