public override void CheckForEvent(IEnumerable<Plane> activePlanes) { // List<ConflictingPlanes> cList = SeparationPlanes((List<Plane>)activePlanes); foreach (var cPlanes in cList) { if (!_tagsList.Contains(cPlanes)) { var e = new AtmEventSeperation() { Level = Levels.Warning, Tags = {cPlanes.Tag1, cPlanes.Tag2}, TimeStamp = TimeProvidor.Now }; RaiseEvent(e); _tagsList.Add(cPlanes); } } foreach (var cPlane in _tagsList.Where(cPlane => !cList.Contains(cPlane))) { var cTags = new List<string>() {cPlane.Tag1,cPlane.Tag2}; foreach (var Event in ActiveAtmEvents) { if (Event.Tags == cTags) { _tagsList.Remove(cPlane); RemoveEvent(Event); } } } }
public override void CheckForEvent(IEnumerable <Plane> activePlanes) { // List <ConflictingPlanes> cList = SeparationPlanes((List <Plane>)activePlanes); foreach (var cPlanes in cList) { if (!_tagsList.Contains(cPlanes)) { var e = new AtmEventSeperation() { Level = Levels.Warning, Tags = { cPlanes.Tag1, cPlanes.Tag2 }, TimeStamp = TimeProvidor.Now }; RaiseEvent(e); _tagsList.Add(cPlanes); } } foreach (var cPlane in _tagsList.Where(cPlane => !cList.Contains(cPlane))) { var cTags = new List <string>() { cPlane.Tag1, cPlane.Tag2 }; foreach (var Event in ActiveAtmEvents) { if (Event.Tags == cTags) { _tagsList.Remove(cPlane); RemoveEvent(Event); } } } }