Exemplo n.º 1
0
        /// <summary>
        /// Constructor from an object deserialized from the settings file.
        /// </summary>
        /// <param name="src">The source.</param>
        /// <exception cref="System.ArgumentNullException">src</exception>
        internal IndustryJob(SerializableJob src)
        {
            src.ThrowIfNull(nameof(src));

            ID = src.JobID;
            State = src.State;
            StartDate = src.StartDate;
            EndDate = src.EndDate;
            PauseDate = src.PauseDate;
            LastStateChange = src.LastStateChange;
            IssuedFor = src.IssuedFor == IssuedFor.None ? IssuedFor.Character : src.IssuedFor;
            ActiveJobState = GetActiveJobState();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor from an object deserialized from the settings file.
 /// </summary>
 /// <param name="src"></param>
 internal IndustryJob(SerializableJob src)
 {
     m_ignored = src.Ignored;
     m_jobID = src.JobID;
     m_state = src.State;
     m_installedItemID = src.InstalledItemID;
     m_installedItem = StaticBlueprints.GetBlueprintByID(src.InstalledItemID);
     m_outputItemID = src.OutputItemID;
     m_outputItem = GetOutputItem(src.OutputItemID);
     m_runs = src.Runs;
     m_activity = src.Activity;
     m_blueprintType = src.BlueprintType;
     m_installation = src.ItemLocation;
     m_solarSystem = StaticGeography.GetSystem(src.SolarSystemID);
     m_installedTime = src.InstalledTime;
     m_installedItemME = src.InstalledItemME;
     m_installedItemPE = src.InstalledItemPE;
     m_beginProductionTime = src.BeginProductionTime;
     m_endProductionTime = src.EndProductionTime;
     m_pauseProductionTime = src.PauseProductionTime;
     m_lastStateChange = src.LastStateChange;
     m_issuedFor = src.IssuedFor;
     m_activeJobState = GetActiveJobState();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Exports the given object to a serialization object.
        /// </summary>
        internal SerializableJob Export()
        {
            var serial = new SerializableJob
                             {
                                 Ignored = m_ignored,
                                 JobID = m_jobID,
                                 State = m_state,
                                 InstalledItemID = m_installedItemID,
                                 InstalledItem = m_installedItem.Name,
                                 OutputItemID = m_outputItemID,
                                 OutputItem = m_outputItem.Name,
                                 Runs = m_runs,
                                 Activity = m_activity,
                                 BlueprintType = m_blueprintType,
                                 ItemLocation = m_installation,
                                 SolarSystemID = m_solarSystem.ID,
                                 InstalledTime = m_installedTime,
                                 InstalledItemME = m_installedItemME,
                                 InstalledItemPE = m_installedItemPE,
                                 BeginProductionTime = m_beginProductionTime,
                                 EndProductionTime = m_endProductionTime,
                                 PauseProductionTime = m_pauseProductionTime,
                                 LastStateChange = m_lastStateChange,
                                 IssuedFor = m_issuedFor
                             };

            return serial;
        }