Пример #1
0
        private static string UpdateSystemType(Map map, string system)
        {
            if (IsWSpaceSystem(system))
            {
                return("A");
            }

            var systemPrevious = map.GetSystem(system);

            var isNeedAddSolarSystemToMap = false;

            foreach (var connected in systemPrevious.ConnectedSolarSystems)
            {
                if (IsWSpaceSystem(connected))
                {
                    return("B");
                }
            }

            foreach (var connected in systemPrevious.ConnectedSolarSystems)
            {
                var connectedSystem = map.GetSystem(connected);

                foreach (var connectedOfConnected in connectedSystem.ConnectedSolarSystems)
                {
                    if (IsWSpaceSystem(connectedOfConnected))
                    {
                        return("C");
                    }
                }
            }

            return("D");
        }
Пример #2
0
        public static List <EveJimaUniverse.System> UpdateSolarSystems(Map map, List <EveJimaUniverse.System> updatedSystems)
        {
            Log.DebugFormat($"[MapTools.UpdateSolarSystems] start for '{map.ActivePilot}' and map '{map.Key}'");

            foreach (var updatedSystem in updatedSystems)
            {
                var system = map.GetSystem(updatedSystem.Name);

                if (system != null)
                {
                    system.LocationInMap = updatedSystem.LocationInMap;
                    Log.DebugFormat("[MapTools.UpdateSolarSystems] For map with key {0} updated system {2} Coordinates {1}", map.Key, system.LocationInMap.X + ":" + system.LocationInMap.Y, system.Name);
                    system.Signatures            = updatedSystem.Signatures;
                    system.ConnectedSolarSystems = updatedSystem.ConnectedSolarSystems;
                }
                else
                {
                    map.Systems.Add(updatedSystem);
                    Log.DebugFormat("[MapTools.UpdateSolarSystems] For map with key {0} added system {2} Coordinates {1}", map.Key, updatedSystem.LocationInMap.X + ":" + updatedSystem.LocationInMap.Y, updatedSystem.Name);
                }
            }

            if (updatedSystems.Count > 0)
            {
                Normalization(map);
            }

            return(map.Systems);
        }
Пример #3
0
        private static void CheckConnectionsForSystem(Map map, string locationSolarSystemName)
        {
            var system = map.GetSystem(locationSolarSystemName);

            _systems.Add(locationSolarSystemName);

            if (system == null)
            {
                return;
            }

            if (system.IsDeleted)
            {
                return;
            }

            system.IsHidden = false;

            foreach (var connection in system.ConnectedSolarSystems)
            {
                if (_systems.Contains(connection) == false)
                {
                    CheckConnectionsForSystem(map, connection);
                }
            }
        }
Пример #4
0
        public static void HideUnconnectedSystems(Map map)
        {
            Log.DebugFormat($"[MapTools.HideUnconnectedSystems] for map {map.Key}. active pilot {map.ActivePilot}");

            if (map.LocationSolarSystemName == null)
            {
                return;
            }

            _systems = new List <string>();

            foreach (var solarSystem in map.Systems)
            {
                solarSystem.IsHidden = true;
            }

            CheckConnectionsForSystem(map, map.LocationSolarSystemName);

            var system = map.GetSystem(map.LocationSolarSystemName);

            system.IsHidden = false;
        }