void IsEmptyRecur(string path, ParallelQuery<string> files) { string pathToTest = path.EndsWith(@"\") ? path : path + @"\"; if (files.Any(f => f.IndexOf(pathToTest.ToLower()) >= 0)) { var dirs = Directory.EnumerateDirectories(path); foreach (var dir in dirs) { IsEmptyRecur(dir, files); } } else { // empty lbFolders.Items.Add(path); } }
private bool DotModifiers(ParallelQuery<Unit> nearEnemies) { var heroModifiers = Hero.HasModifiers(cantToggleArmletHeroModifiers, false); var enemyModifiers = nearEnemies.Any(x => x.HasModifiers(cantToggleArmletEnemyModifiers, false)); return enemyModifiers || heroModifiers; }