/// <summary> /// Constructor. /// </summary> /// <param name="src"></param> public Station(SolarSystem owner, SerializableStation src) { m_id = src.ID; m_name = src.Name; m_corporationID = src.CorporationID; m_corporationName = src.CorporationName; m_owner = owner; m_reprocessingTake = src.ReprocessingStationsTake; m_reprocessingEfficiency = src.ReprocessingEfficiency; m_agents = new FastList <SerializableAgent>(src.Agents != null ? src.Agents.Length : 0); if (src.Agents == null) { return; } foreach (var agent in src.Agents) { m_agents.Add(agent); } }
/// <summary> /// Completes the initialization. /// </summary> /// <param name="datafile">The datafile.</param> private static void CompleteInitialization(GeoDatafile datafile) { // Connects the systems foreach (SerializableJump srcJump in datafile.Jumps) { SolarSystem a = GetSolarSystemByID(srcJump.FirstSystemID); SolarSystem b = GetSolarSystemByID(srcJump.SecondSystemID); if (a == null || b == null) { continue; } a.AddNeighbor(b); b.AddNeighbor(a); } foreach (SolarSystem system in s_solarSystemsByID.Values) { system.TrimNeighbors(); } }
/// <summary> /// Gets the station's full location. /// </summary> /// <param name="solarSystem">The solar system.</param> /// <param name="name">The name.</param> /// <returns></returns> private static string GetFullLocation(SolarSystem solarSystem, string name) => solarSystem == null ? String.Empty : $"{solarSystem.FullLocation} > {name}";
/// <summary> /// Constructor for a child. /// </summary> /// <param name="parent"></param> /// <param name="system"></param> private PathFinder(PathFinder parent, SolarSystem system) { m_parent = parent; m_system = system; }
/// <summary> /// Constructor for a starting point /// </summary> /// <param name="system"></param> private PathFinder(SolarSystem system) { m_parent = null; m_system = system; }
/// <summary> /// Adds a neighbor with a jumpgate connection to this system. /// </summary> /// <param name="system"></param> internal void AddNeighbor(SolarSystem system) { m_jumps.Add(system); }
/// <summary> /// Find the guessed shortest path using a A* (heuristic) algorithm. /// </summary> /// <param name="target">The target system.</param> /// <param name="minSecurityLevel">The mininmum, inclusive, real security level. Systems have levels between -1 and +1.</param> /// <returns>The list of systems, beginning with this one and ending with the provided target.</returns> public List <SolarSystem> GetFastestPathTo(SolarSystem target, float minSecurityLevel) { return(PathFinder.FindBestPath(this, target, minSecurityLevel)); }