Ejemplo n.º 1
0
        private void FilterInput(object sender, AirplaneArgs e)
        {
            RelevantPlanes.Clear();

            foreach (Plane NewPlane in e._planes)
            {
                if (10000 <= NewPlane.XCoordinate && NewPlane.XCoordinate <= 90000 && 10000 <= NewPlane.YCoordinate && NewPlane.YCoordinate <= 90000 &&
                    500 <= NewPlane.ZCoordinate && NewPlane.ZCoordinate <= 20000)
                {
                    if (RelevantPlanes != null)
                    {
                        NewRelevantPlaneReceived(NewPlane);
                    }
                }
            }

            if (RelevantPlanes.Count > 0)
            {
                OnRelevantAirplanesReceivedEvent(new RelevantAirplaneArgs {
                    _relevantPlanes = RelevantPlanes
                });
                //foreach (Plane plane in RelevantPlanes)
                //{
                //    System.Console.WriteLine($"{plane}");
                //}
            }
        }
Ejemplo n.º 2
0
 protected virtual void OnDataReceivedEvent(AirplaneArgs e)
 {
     DataReceivedEvent?.Invoke(this, e);
 }