/// <summary> /// Remove invalid healableunits. /// </summary> public static void Remove() { try { if (Adding) { return; } Removing = true; var grp = ListofHealableUnits.Where(n => !HealableUnit.Filter(n.ToUnit())).ToList(); foreach (var unit in grp.Where(unit => ListofHealableUnits.IndexOf(unit) != -1)) { ListofHealableUnits.RemoveAt(ListofHealableUnits.IndexOf(unit)); // remove CLULogger.TroubleshootLog(" Success Removed: {0} no longer a valid healableunit.", CLULogger.SafeName(unit.ToUnit())); } Removing = false; } catch (Exception ex) { CLULogger.DiagnosticLog("Remove : {0}", ex); } }
/// <summary> /// Checks to see the specified unit is not present in our current List of HealableUnits /// </summary> /// <param name="unit">the unit to check for</param> public static bool Contains(WoWUnit unit) { try { var grp = ListofHealableUnits.ToList(); return(grp.Any(n => n != null && (unit != null && n.ToUnit().Guid == unit.Guid))); } catch (Exception ex) { CLULogger.DiagnosticLog("Contains : {0}", ex); } return(false); }