private List<PlanetInfo> FilteredPlanetList(StarSystemInfo system) { List<PlanetInfo> list = ((IEnumerable<PlanetInfo>)this.App.GameDatabase.GetStarSystemPlanetInfos(system.ID)).ToList<PlanetInfo>(); List<PlanetInfo> planetInfoList = new List<PlanetInfo>(); foreach (PlanetInfo planetInfo in list) { if (this.App.GameDatabase.IsSurveyed(this.App.LocalPlayer.ID, system.ID)) { if (this._currentFilterMode == DialogSystemIntel.PlanetFilterMode.AllPlanets) planetInfoList.Add(planetInfo); else if (this._currentFilterMode == DialogSystemIntel.PlanetFilterMode.SurveyedPlanets) { if (this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID) == null) planetInfoList.Add(planetInfo); } else if (this._currentFilterMode == DialogSystemIntel.PlanetFilterMode.OwnedPlanets) { AIColonyIntel colonyIntelForPlanet = this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID); if (colonyIntelForPlanet != null && colonyIntelForPlanet.OwningPlayerID == this.App.LocalPlayer.ID) planetInfoList.Add(planetInfo); } else if (this._currentFilterMode == DialogSystemIntel.PlanetFilterMode.EnemyPlanets) { AIColonyIntel colonyIntelForPlanet = this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID); if (colonyIntelForPlanet != null && colonyIntelForPlanet.OwningPlayerID != this.App.LocalPlayer.ID) planetInfoList.Add(planetInfo); } } } return planetInfoList; }
public static void SyncPlanetItemControl( GameSession game, string panelName, OrbitalObjectInfo orbital) { PlanetInfo planetInfo = game.GameDatabase.GetPlanetInfo(orbital.ID); if (planetInfo == null) { return; } game.GameDatabase.GetMoons(orbital.ID); string propertyValue = App.Localize("@UI_PLANET_TYPE_" + planetInfo.Type.ToUpperInvariant()); Vector4 color = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); AIColonyIntel colonyIntelForPlanet = game.GameDatabase.GetColonyIntelForPlanet(game.LocalPlayer.ID, planetInfo.ID); if (colonyIntelForPlanet != null) { PlayerInfo playerInfo = game.GameDatabase.GetPlayerInfo(colonyIntelForPlanet.OwningPlayerID); color.X = playerInfo.PrimaryColor.X * (float)byte.MaxValue; color.Y = playerInfo.PrimaryColor.Y * (float)byte.MaxValue; color.Z = playerInfo.PrimaryColor.Z * (float)byte.MaxValue; color.W = (float)byte.MaxValue; } game.UI.AddItem(panelName, string.Empty, orbital.ID, string.Empty); string itemGlobalId = game.UI.GetItemGlobalID(panelName, string.Empty, orbital.ID, string.Empty); string panelId = game.UI.Path(itemGlobalId, "expand_button"); game.UI.SetVisible(panelId, false); bool flag = game.GameDatabase.CanColonizePlanet(game.LocalPlayer.ID, planetInfo.ID, game.GameDatabase.GetStratModifier <int>(StratModifiers.MaxColonizableHazard, game.LocalPlayer.ID)) || colonyIntelForPlanet != null && colonyIntelForPlanet.PlayerID == game.LocalPlayer.ID; game.UI.SetVisible(game.UI.Path(itemGlobalId, "header_idle.idle.h_good"), (flag ? 1 : 0) != 0); game.UI.SetVisible(game.UI.Path(itemGlobalId, "header_idle.idle.h_bad"), (!flag ? 1 : 0) != 0); game.UI.SetVisible(game.UI.Path(itemGlobalId, "header_idle.mouse_over.h_good"), (flag ? 1 : 0) != 0); game.UI.SetVisible(game.UI.Path(itemGlobalId, "header_idle.mouse_over.h_bad"), (!flag ? 1 : 0) != 0); game.UI.SetVisible(game.UI.Path(itemGlobalId, "header_sel.idle.h_good"), (flag ? 1 : 0) != 0); game.UI.SetVisible(game.UI.Path(itemGlobalId, "header_sel.idle.h_bad"), (!flag ? 1 : 0) != 0); game.UI.SetVisible(game.UI.Path(itemGlobalId, "header_sel.mouse_over.h_good"), (flag ? 1 : 0) != 0); game.UI.SetVisible(game.UI.Path(itemGlobalId, "header_sel.mouse_over.h_bad"), (!flag ? 1 : 0) != 0); FleetUI.SyncSelectablePlanetListControl(game, itemGlobalId, "header_idle.idle", orbital.Name, color, false); FleetUI.SyncSelectablePlanetListControl(game, itemGlobalId, "header_idle.mouse_over", orbital.Name, color, false); FleetUI.SyncSelectablePlanetListControl(game, itemGlobalId, "header_sel.idle", orbital.Name, color, true); FleetUI.SyncSelectablePlanetListControl(game, itemGlobalId, "header_sel.mouse_over", orbital.Name, color, true); game.UI.SetPropertyString(game.UI.Path(itemGlobalId, "planetItemPlanetType"), "text", propertyValue); game.UI.AutoSize(game.UI.Path(itemGlobalId, "expanded")); }
private List <PlanetInfo> FilteredPlanetList(StarSystemInfo system) { List <PlanetInfo> list = ((IEnumerable <PlanetInfo>) this.App.GameDatabase.GetStarSystemPlanetInfos(system.ID)).ToList <PlanetInfo>(); List <PlanetInfo> planetInfoList = new List <PlanetInfo>(); foreach (PlanetInfo planetInfo in list) { if (this.App.GameDatabase.IsSurveyed(this.App.LocalPlayer.ID, system.ID)) { AIColonyIntel colonyIntelForPlanet = this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID); if (colonyIntelForPlanet != null && colonyIntelForPlanet.OwningPlayerID == this.App.LocalPlayer.ID) { planetInfoList.Add(planetInfo); } } } return(planetInfoList); }
private List <PlanetInfo> FilteredPlanetList(StarSystemInfo system) { List <PlanetInfo> list = this.App.GameDatabase.GetPlanetInfosOrbitingStar(system.ID).ToList <PlanetInfo>(); List <PlanetInfo> planetInfoList = new List <PlanetInfo>(); foreach (PlanetInfo planetInfo in list) { if (this.App.GameDatabase.IsSurveyed(this.App.LocalPlayer.ID, system.ID)) { if (this._currentFilterMode == PlanetManagerState.PlanetFilterMode.AllPlanets) { planetInfoList.Add(planetInfo); } else if (this._currentFilterMode == PlanetManagerState.PlanetFilterMode.SurveyedPlanets) { if (this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID) == null) { planetInfoList.Add(planetInfo); } } else if (this._currentFilterMode == PlanetManagerState.PlanetFilterMode.OwnedPlanets) { ColonyInfo colonyInfoForPlanet = this.App.GameDatabase.GetColonyInfoForPlanet(planetInfo.ID); if (colonyInfoForPlanet != null && colonyInfoForPlanet.PlayerID == this.App.LocalPlayer.ID) { planetInfoList.Add(planetInfo); } } else if (this._currentFilterMode == PlanetManagerState.PlanetFilterMode.EnemyPlanets) { AIColonyIntel colonyIntelForPlanet = this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID); if (colonyIntelForPlanet != null && colonyIntelForPlanet.OwningPlayerID != this.App.LocalPlayer.ID) { planetInfoList.Add(planetInfo); } } } } return(planetInfoList); }
private List <PlanetInfo> FilteredPlanetList(StarSystemInfo system) { List <PlanetInfo> list = ((IEnumerable <PlanetInfo>) this.App.GameDatabase.GetStarSystemPlanetInfos(system.ID)).ToList <PlanetInfo>(); List <PlanetInfo> source = new List <PlanetInfo>(); foreach (PlanetInfo planetInfo in list) { if (this.App.GameDatabase.IsSurveyed(this.App.LocalPlayer.ID, system.ID)) { if (this._currentFilterMode == PlanetManagerDialog.PlanetFilterMode.AllPlanets) { source.Add(planetInfo); } else if (this._currentFilterMode == PlanetManagerDialog.PlanetFilterMode.SurveyedPlanets) { if (this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID) == null) { source.Add(planetInfo); } } else if (this._currentFilterMode == PlanetManagerDialog.PlanetFilterMode.OwnedPlanets) { AIColonyIntel colonyIntelForPlanet = this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID); if (colonyIntelForPlanet != null && colonyIntelForPlanet.OwningPlayerID == this.App.LocalPlayer.ID) { source.Add(planetInfo); } } else if (this._currentFilterMode == PlanetManagerDialog.PlanetFilterMode.EnemyPlanets) { AIColonyIntel colonyIntelForPlanet = this.App.GameDatabase.GetColonyIntelForPlanet(this.App.LocalPlayer.ID, planetInfo.ID); if (colonyIntelForPlanet != null && colonyIntelForPlanet.OwningPlayerID != this.App.LocalPlayer.ID) { source.Add(planetInfo); } } } } if (source.Any <PlanetInfo>()) { if (this._currentOrderMode == PlanetManagerDialog.PlanetOrderMode.PlanetHazard) { PlanetManagerDialog.sortPlanetHazard sortPlanetHazard = new PlanetManagerDialog.sortPlanetHazard(this._app); source.Sort((IComparer <PlanetInfo>)sortPlanetHazard); } else if (this._currentOrderMode == PlanetManagerDialog.PlanetOrderMode.PlanetDevCost) { PlanetManagerDialog.sortPlanetDevCost sortPlanetDevCost = new PlanetManagerDialog.sortPlanetDevCost(this._app); source.Sort((IComparer <PlanetInfo>)sortPlanetDevCost); } else if (this._currentOrderMode == PlanetManagerDialog.PlanetOrderMode.PlanetSize) { PlanetManagerDialog.sortPlanetSize sortPlanetSize = new PlanetManagerDialog.sortPlanetSize(this._app); source.Sort((IComparer <PlanetInfo>)sortPlanetSize); } else if (this._currentOrderMode == PlanetManagerDialog.PlanetOrderMode.PlanetResources) { PlanetManagerDialog.sortPlanetResources sortPlanetResources = new PlanetManagerDialog.sortPlanetResources(this._app); source.Sort((IComparer <PlanetInfo>)sortPlanetResources); } else if (this._currentOrderMode == PlanetManagerDialog.PlanetOrderMode.PlanetBioSphere) { PlanetManagerDialog.sortPlanetBiosphere sortPlanetBiosphere = new PlanetManagerDialog.sortPlanetBiosphere(this._app); source.Sort((IComparer <PlanetInfo>)sortPlanetBiosphere); } else if (this._currentOrderMode == PlanetManagerDialog.PlanetOrderMode.PlanetInfra) { PlanetManagerDialog.sortPlanetInfra sortPlanetInfra = new PlanetManagerDialog.sortPlanetInfra(this._app); source.Sort((IComparer <PlanetInfo>)sortPlanetInfra); } } return(source); }
internal static void Sync(App game, int systemId, string mapPanelId, bool isClickable) { bool flag = StarMap.IsInRange(game.Game.GameDatabase, game.LocalPlayer.ID, game.GameDatabase.GetStarSystemInfo(systemId), (Dictionary <int, List <ShipInfo> >)null); StarSystemMapUI.ResetMap(game, mapPanelId); if (systemId == 0) { return; } float time = 0.0f; GameDatabase gameDatabase = game.GameDatabase; IEnumerable <OrbitalObjectInfo> orbitalObjectInfos = gameDatabase.GetStarSystemOrbitalObjectInfos(systemId); StarSystemInfo starSystemInfo = gameDatabase.GetStarSystemInfo(systemId); StellarClass stellarClass = StellarClass.Parse(starSystemInfo.StellarClass); if (starSystemInfo.IsDeepSpace) { return; } float num1 = StarHelper.CalcRadius(StellarSize.Ia); float num2 = StarHelper.CalcRadius(StellarSize.VII); float num3 = ScalarExtensions.Lerp(0.67f, 3f, (float)(((double)StarHelper.CalcRadius(stellarClass.Size) - (double)num2) / ((double)num1 - (double)num2))); StarSystemMapUI.IconParams iconParams1 = StarSystemMapUI.IconParams.Default; iconParams1.ObjectID = StarSystemDetailsUI.StarItemID; iconParams1.Text = starSystemInfo.Name; iconParams1.Icon = "sysmap_star"; iconParams1.X = 0.0f; iconParams1.Y = 0.0f; iconParams1.Scale = num3; iconParams1.Color = StarHelper.CalcIconColor(stellarClass); iconParams1.Clickable = isClickable; StarSystemMapUI.AddMapIcon(game, mapPanelId, iconParams1); foreach (AsteroidBeltInfo asteroidBeltInfo in gameDatabase.GetStarSystemAsteroidBeltInfos(systemId)) { AsteroidBeltInfo asteroidBelt = asteroidBeltInfo; OrbitalObjectInfo orbitalObjectInfo = orbitalObjectInfos.First <OrbitalObjectInfo>((Func <OrbitalObjectInfo, bool>)(x => x.ID == asteroidBelt.ID)); StarSystemMapUI.IconParams iconParams2 = new StarSystemMapUI.IconParams(); iconParams2.SetPos(game, orbitalObjectInfos, time, orbitalObjectInfo.ID); iconParams2.ObjectID = orbitalObjectInfo.ID; iconParams2.Icon = "sysmap_roiddust"; iconParams2.Scale = 0.85f; iconParams2.Color = Vector4.One; iconParams2.Text = orbitalObjectInfo.Name; iconParams2.Clickable = false; StarSystemMapUI.AddMapIcon(game, mapPanelId, iconParams2); } PlanetInfo[] systemPlanetInfos = gameDatabase.GetStarSystemPlanetInfos(systemId); foreach (OrbitalObjectInfo orbitalObjectInfo in orbitalObjectInfos.Where <OrbitalObjectInfo>((Func <OrbitalObjectInfo, bool>)(x => !x.ParentID.HasValue))) { OrbitalObjectInfo orbital = orbitalObjectInfo; PlanetInfo planetInfo = ((IEnumerable <PlanetInfo>)systemPlanetInfos).FirstOrDefault <PlanetInfo>((Func <PlanetInfo, bool>)(x => x.ID == orbital.ID)); if (planetInfo != null) { string str = StarSystemMapUI.SelectIcon(planetInfo, orbitalObjectInfos, (IEnumerable <PlanetInfo>)systemPlanetInfos); if (string.IsNullOrEmpty(str)) { App.Log.Trace(string.Format("Planet {0} does not have an icon to represent it in the mini system map.", (object)orbital.Name), "gui"); } else { AIColonyIntel colonyIntelForPlanet = game.GameDatabase.GetColonyIntelForPlanet(game.LocalPlayer.ID, planetInfo.ID); if (colonyIntelForPlanet != null && flag) { Vector3 primaryColor = game.GameDatabase.GetPlayerInfo(colonyIntelForPlanet.OwningPlayerID).PrimaryColor; Vector4 vector4 = new Vector4(primaryColor.X, primaryColor.Y, primaryColor.Z, 1f); StarSystemMapUI.IconParams iconParams2 = StarSystemMapUI.IconParams.Default; iconParams2.SetPos(game, orbitalObjectInfos, time, planetInfo.ID); iconParams2.ObjectID = 0; iconParams2.Icon = "sysmap_ownerring"; iconParams2.Scale = 0.85f; iconParams2.Color = vector4; iconParams2.Text = string.Empty; iconParams2.Clickable = false; StarSystemMapUI.AddMapIcon(game, mapPanelId, iconParams2); } StarSystemMapUI.IconParams iconParams3 = new StarSystemMapUI.IconParams(); iconParams3.SetPos(game, orbitalObjectInfos, time, planetInfo.ID); iconParams3.ObjectID = planetInfo.ID; iconParams3.Icon = str; iconParams3.Scale = 0.85f; iconParams3.Color = Vector4.One; iconParams3.Text = orbital.Name; iconParams3.Clickable = isClickable; StarSystemMapUI.AddMapIcon(game, mapPanelId, iconParams3); } } } }
protected override void UpdateSystem( StarMapSystem o, StarSystemInfo systemInfo, StarMapBase.SyncContext context) { int?systemProvinceId = this._db.GetStarSystemProvinceID(systemInfo.ID); o.SetProvince(systemProvinceId.HasValue ? this.Provinces.Reverse[systemProvinceId.Value] : (StarMapProvince)null); o.SetPosition(systemInfo.Origin); o.SetTerrain(systemInfo.TerrainID.HasValue ? this.Terrain.Reverse[systemInfo.TerrainID.Value] : (StarMapTerrain)null); IEnumerable <int> orbitalObjectIds = this._db.GetStarSystemOrbitalObjectIDs(systemInfo.ID); List <int> source = new List <int>(); bool flag1 = false; List <StationInfo> list1 = this._db.GetStationForSystem(systemInfo.ID).Where <StationInfo>((Func <StationInfo, bool>)(x => x.DesignInfo.StationType == StationType.NAVAL)).ToList <StationInfo>(); Dictionary <int, int> dictionary1 = new Dictionary <int, int>(); bool flag2 = false; foreach (int planetID in orbitalObjectIds) { AIColonyIntel ci = this._db.GetColonyIntelForPlanet(this._sim.LocalPlayer.ID, planetID); if (ci != null) { if (!dictionary1.ContainsKey(ci.OwningPlayerID)) { dictionary1.Add(ci.OwningPlayerID, 0); } Dictionary <int, int> dictionary2; int owningPlayerId; (dictionary2 = dictionary1)[owningPlayerId = ci.OwningPlayerID] = dictionary2[owningPlayerId] + 1; if (ci.OwningPlayerID == this._sim.LocalPlayer.ID) { flag1 = true; } source.Add(ci.OwningPlayerID); List <TreatyInfo> list2 = this._sim.GameDatabase.GetTreatyInfos().ToList <TreatyInfo>().Where <TreatyInfo>((Func <TreatyInfo, bool>)(x => x.Type == TreatyType.Trade)).ToList <TreatyInfo>(); if (flag1 || list2.Any <TreatyInfo>((Func <TreatyInfo, bool>)(x => { if (x.InitiatingPlayerId == this._sim.LocalPlayer.ID && x.ReceivingPlayerId == ci.OwningPlayerID) { return(true); } if (x.ReceivingPlayerId == this._sim.LocalPlayer.ID) { return(x.InitiatingPlayerId == ci.OwningPlayerID); } return(false); }))) { flag2 = true; } } } if (dictionary1.Count == 0) { foreach (StationInfo stationInfo in list1) { if (stationInfo.PlayerID == this._sim.LocalPlayer.ID) { flag1 = true; } } } if (flag1) { float supportRange = GameSession.GetSupportRange(this._db.AssetDatabase, this._db, this._sim.LocalPlayer.ID); o.SetSupportRange(supportRange); } int?systemOwningPlayer = this._db.GetSystemOwningPlayer(systemInfo.ID); if (systemOwningPlayer.HasValue && this._sim.GameDatabase.IsStarSystemVisibleToPlayer(this._sim.LocalPlayer.ID, systemInfo.ID) && StarMap.IsInRange(this._sim.GameDatabase, this._sim.LocalPlayer.ID, systemInfo.ID)) { o.SetPlayerBadge(Path.GetFileNameWithoutExtension(this._db.GetPlayerInfo(systemOwningPlayer.Value).BadgeAssetPath)); o.SetOwningPlayer(this._sim.GetPlayerObject(systemOwningPlayer.Value)); } else { o.SetPlayerBadge(""); o.SetOwningPlayer((Player)null); } source.Sort(); o.SetPlayers(source.Select <int, Player>((Func <int, Player>)(playerId => this._sim.GetPlayerObject(playerId))).ToArray <Player>()); List <PlayerInfo> playerInfos = context.PlayerInfos; List <Player> playerList1 = new List <Player>(); List <Player> playerList2 = new List <Player>(); foreach (PlayerInfo playerInfo in playerInfos) { if (this._db.SystemHasGate(systemInfo.ID, playerInfo.ID) && (playerInfo.ID == this._sim.LocalPlayer.ID || this._db.IsSurveyed(this._sim.LocalPlayer.ID, systemInfo.ID) && StarMap.IsInRange(this._db, playerInfo.ID, systemInfo.ID))) { playerList1.Add(this._sim.GetPlayerObject(playerInfo.ID)); } if (this._db.SystemHasAccelerator(systemInfo.ID, playerInfo.ID) && (playerInfo.ID == this._sim.LocalPlayer.ID || this._db.IsSurveyed(this._sim.LocalPlayer.ID, systemInfo.ID) && StarMap.IsInRange(this._db, playerInfo.ID, systemInfo.ID))) { playerList2.Add(this._sim.GetPlayerObject(playerInfo.ID)); } IEnumerable <StationInfo> forSystemAndPlayer = this._db.GetStationForSystemAndPlayer(systemInfo.ID, playerInfo.ID); if (playerInfo.ID == this._sim.LocalPlayer.ID) { o.SetHasNavalStation(forSystemAndPlayer.Any <StationInfo>((Func <StationInfo, bool>)(x => { if (x.PlayerID == this._sim.LocalPlayer.ID && x.DesignInfo.StationLevel > 0) { return(x.DesignInfo.StationType == StationType.NAVAL); } return(false); }))); o.SetHasScienceStation(forSystemAndPlayer.Any <StationInfo>((Func <StationInfo, bool>)(x => { if (x.PlayerID == this._sim.LocalPlayer.ID && x.DesignInfo.StationLevel > 0) { return(x.DesignInfo.StationType == StationType.SCIENCE); } return(false); }))); o.SetHasTradeStation(forSystemAndPlayer.Any <StationInfo>((Func <StationInfo, bool>)(x => { if (x.PlayerID == this._sim.LocalPlayer.ID && x.DesignInfo.StationLevel > 0) { return(x.DesignInfo.StationType == StationType.CIVILIAN); } return(false); }))); o.SetHasDiploStation(forSystemAndPlayer.Any <StationInfo>((Func <StationInfo, bool>)(x => { if (x.PlayerID == this._sim.LocalPlayer.ID && x.DesignInfo.StationLevel > 0) { return(x.DesignInfo.StationType == StationType.DIPLOMATIC); } return(false); }))); } o.SetStationCapacity(this._db.GetNumberMaxStationsSupportedBySystem(this._sim, systemInfo.ID, this._sim.LocalPlayer.ID)); if (playerInfo.ID == this._sim.LocalPlayer.ID && systemOwningPlayer.HasValue) { int cruiserEquivalent = this._db.GetSystemSupportedCruiserEquivalent(this._sim, systemInfo.ID, playerInfo.ID); int remainingSupportPoints = this._db.GetRemainingSupportPoints(this._sim, systemInfo.ID, playerInfo.ID); if (systemOwningPlayer.Value == this._sim.LocalPlayer.ID) { o.SetNavalCapacity(cruiserEquivalent); o.SetNavalUsage(cruiserEquivalent - remainingSupportPoints); } else { o.SetNavalCapacity(0); o.SetNavalUsage(0); } } } o.SetColonyTrapped(this._sim.GameDatabase.GetColonyTrapInfosAtSystem(systemInfo.ID).Where <ColonyTrapInfo>((Func <ColonyTrapInfo, bool>)(x => { if (this._sim.GameDatabase.GetFleetInfo(x.FleetID) != null) { return(this._sim.GameDatabase.GetFleetInfo(x.FleetID).PlayerID == this._sim.LocalPlayer.ID); } return(false); })).Any <ColonyTrapInfo>()); o.SetPlayersWithGates(playerList1.ToArray()); o.SetPlayersWithAccelerators(playerList2.ToArray()); o.SetSensorRange(this._sim.GameDatabase.GetSystemStratSensorRange(systemInfo.ID, this._sim.LocalPlayer.ID)); TradeResultsTable tradeResultsTable = this._sim.GameDatabase.GetTradeResultsTable(); TradeResultsTable resultsHistoryTable = this._sim.GameDatabase.GetLastTradeResultsHistoryTable(); if (flag2 && tradeResultsTable.TradeNodes.ContainsKey(systemInfo.ID)) { if (resultsHistoryTable.TradeNodes.ContainsKey(systemInfo.ID)) { o.SetTradeValues(this._sim, tradeResultsTable.TradeNodes[systemInfo.ID], resultsHistoryTable.TradeNodes[systemInfo.ID], systemInfo.ID); } else { o.SetTradeValues(this._sim, tradeResultsTable.TradeNodes[systemInfo.ID], new TradeNode(), systemInfo.ID); } } else { o.SetTradeValues(this._sim, new TradeNode(), new TradeNode(), systemInfo.ID); } int exploredByPlayer = this._db.GetLastTurnExploredByPlayer(this._sim.LocalPlayer.ID, systemInfo.ID); int turnCount = this._db.GetTurnCount(); o.SetIsSurveyed(exploredByPlayer != 0); this.SetSystemHasBeenRecentlySurveyed(this.Systems.Reverse[systemInfo.ID], exploredByPlayer != 0 && turnCount - exploredByPlayer <= 5 && !flag1); this.SetSystemHasRecentCombat(this.Systems.Reverse[systemInfo.ID], this._sim.CombatData.GetFirstCombatInSystem(this._sim.GameDatabase, systemInfo.ID, this._sim.GameDatabase.GetTurnCount() - 1) != null); this.SetSystemIsMissionTarget(this.Systems.Reverse[systemInfo.ID], this._db.GetPlayerMissionInfosAtSystem(this._sim.LocalPlayer.ID, systemInfo.ID).Any <MissionInfo>(), this._db.GetPlayerInfo(this._sim.LocalPlayer.ID).PrimaryColor); bool flag3 = SuperNova.IsPlayerSystemsInSuperNovaEffectRanges(this._db, this._sim.LocalPlayer.ID, systemInfo.ID) || NeutronStar.IsPlayerSystemsInNeutronStarEffectRanges(this._sim, this._sim.LocalPlayer.ID, systemInfo.ID); this.SetSystemRequriesSuperNovaWarning(this.Systems.Reverse[systemInfo.ID], flag3); this.UpdateSystemTrade(systemInfo.ID); o.SetHasLoaGate(this._db.GetFleetInfoBySystemID(systemInfo.ID, FleetType.FL_ACCELERATOR).Any <FleetInfo>()); }