コード例 #1
0
        private void setupStations()
        {
            IOrderedEnumerable <Station> stations = Stations.OrderBy(s => s.Distance);

            Station_BestOrbitalLarge  = null;
            Station_BestOrbitalMedium = null;
            Station_BestPlanetary     = null;
            Station_MaterialTrader    = null;
            foreach (var station in stations)
            {
                station.CurrentSystem = this;
                if (station.HasMaterialTrader)
                {
                    Station_MaterialTrader = station;
                }
                if (Station_BestPlanetary == null && station.RelevantType == RelevantStationType.Planetary)
                {
                    Station_BestPlanetary = station;
                }
                else if (Station_BestOrbitalLarge == null && station.RelevantType == RelevantStationType.OrbitalLarge)
                {
                    Station_BestOrbitalLarge = station;
                }
                else if (Station_BestOrbitalMedium == null && station.RelevantType == RelevantStationType.OrbitalMedium)
                {
                    Station_BestOrbitalMedium = station;
                }
            }
        }
コード例 #2
0
ファイル: Route.cs プロジェクト: fadoe/FPLedit
 public List <Station> GetOrderedStations()
 => Stations.OrderBy(s => s.Positions.GetPosition(Index)).ToList();