public void AddUnit(DetectedUnit detectedUnit) { if (!DetectedUnits.Exists(u => u.Id == detectedUnit.Id)) { DetectedUnits.Add(detectedUnit); detectedUnit.DetectedGroupId = this.Id; SetDirty(GameConstants.DirtyStatus.UnitChanged); } }
public bool RemoveUnit(DetectedUnit detectedUnit) { bool result = DetectedUnits.Remove(detectedUnit); if (result) { detectedUnit.DetectedGroupId = string.Empty; SetDirty(GameConstants.DirtyStatus.UnitChanged); } return(result); }