Exemplo n.º 1
0
 public bool HasSameTagsAs(SeperationEvent other)
 {
     if ((Flight_A.GetTag() == other.Flight_A.GetTag() && Flight_B.GetTag() == other.Flight_B.GetTag()) ||
         (Flight_A.GetTag() == other.Flight_B.GetTag() && Flight_B.GetTag() == other.Flight_A.GetTag()))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        public void OnCreateSeperation(object s, SeperationEvent collision)
        {
            var text = CreateString(collision.Collisiontracks);
            var file = @".\Collisions.txt";

            using (StreamWriter writer = File.AppendText(file))
            {
                foreach (var line in text)
                {
                    writer.WriteLine((string)line);
                }
            }
        }
Exemplo n.º 3
0
 private void CheckForSeperationEvents(List <IFlightTrack> flights)
 {
     for (int i = 0; i < flights.Count; i++)
     {
         for (int j = i + 1; j < flights.Count; j++)
         {
             IFlightTrack f1 = flights[i];
             IFlightTrack f2 = flights[j];
             if (TracksConflicting(f1, f2))
             {
                 SeperationEvent detectedSeperation = new SeperationEvent(f1, f2);
                 SeperationEventDetected?.Invoke(this, new SeperationDetectedEventArgs(detectedSeperation));
             }
         }
     }
 }