コード例 #1
0
ファイル: DataProviderService.cs プロジェクト: lagoth/EDDI
        private static StarSystem GetSystemExtras(StarSystem starSystem, bool showInformation, bool showBodies, bool showStations, bool showFactions)
        {
            if (starSystem != null)
            {
                if (showBodies)
                {
                    List <Body> bodies = StarMapService.GetStarMapBodies(starSystem.name);
                    starSystem.bodies = bodies;
                }

                if (starSystem?.population > 0)
                {
                    List <Faction> factions = new List <Faction>();
                    if (showFactions || showStations)
                    {
                        factions            = StarMapService.GetStarMapFactions(starSystem.name);
                        starSystem.factions = factions;
                    }
                    if (showStations)
                    {
                        List <Station> stations = StarMapService.GetStarMapStations(starSystem.name);
                        starSystem.stations = SetStationFactionData(stations, factions);
                        starSystem.stations = stations;
                    }
                }

                starSystem = LegacyEddpService.SetLegacyData(starSystem, showInformation, showBodies, showStations);
            }

            return(starSystem);
        }
コード例 #2
0
        private static StarSystem GetSystemExtras(StarSystem starSystem, bool showInformation, bool showBodies, bool showStations, bool showFactions)
        {
            if (starSystem != null)
            {
                if (showBodies)
                {
                    List <Body> bodies = StarMapService.GetStarMapBodies(starSystem.name) ?? new List <Body>();
                    foreach (Body body in bodies)
                    {
                        body.systemname    = starSystem.name;
                        body.systemAddress = starSystem.systemAddress;
                        body.systemEDDBID  = starSystem.EDDBID;
                        starSystem.bodies.Add(body);
                    }
                }

                if (starSystem?.population > 0)
                {
                    List <Faction> factions = new List <Faction>();
                    if (showFactions || showStations)
                    {
                        factions            = StarMapService.GetStarMapFactions(starSystem.name);
                        starSystem.factions = factions;
                    }
                    if (showStations)
                    {
                        List <Station> stations = StarMapService.GetStarMapStations(starSystem.name);
                        starSystem.stations = SetStationFactionData(stations, factions);
                        starSystem.stations = stations;
                    }
                }

                starSystem = LegacyEddpService.SetLegacyData(starSystem, showInformation, showBodies, showStations);
            }

            return(starSystem);
        }