コード例 #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);
        }
コード例 #3
0
        private StarSystem GetSystemExtras(StarSystem starSystem, bool showInformation, bool showBodies, bool showStations, bool showFactions)
        {
            if (starSystem != null)
            {
                if (showBodies)
                {
                    List <Body> bodies = edsmService.GetStarMapBodies(starSystem.systemname) ?? new List <Body>();
                    foreach (Body body in bodies)
                    {
                        body.systemname    = starSystem.systemname;
                        body.systemAddress = starSystem.systemAddress;
                    }
                    starSystem.AddOrUpdateBodies(bodies);
                }

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

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