Beispiel #1
0
        public Vector3?FindOverSystem(int x, int y, out double cursysdistz, StarGrid.TransFormInfo ti,
                                      bool showstars, bool showstations)   // UI Call.
        {
            Debug.Assert(Application.MessageLoop);

            cursysdistz = double.MaxValue;
            Vector3?ret = null;

            if (showstars)                        // populated grid is in this list, so will be checked
            {
                foreach (StarGrid grd in grids)
                {
                    Vector3?cur = grd.FindPoint(x, y, ref cursysdistz, ti);
                    if (cur != null)        // if found one, better than cursysdistz, use it
                    {
                        ret = cur;
                    }
                }
            }
            else if (showstations)
            {
                ret = populatedgrid.FindPoint(x, y, ref cursysdistz, ti);
            }

            return(ret);
        }