Esempio n. 1
0
        /// <summary>
        /// Gets the location.
        /// </summary>
        /// <returns></returns>
        private string GetLocation()
        {
            if (m_locationID == 0)
            {
                return(String.Empty);
            }

            string location = m_locationID.ToString(CultureConstants.InvariantCulture);

            if (m_locationID > Int32.MaxValue)
            {
                return(location);
            }

            int     locationID = Convert.ToInt32(LocationID);
            Station station    = EveIDToStation.GetIDToStation(locationID);

            SolarSystem = station == null
                ? StaticGeography.GetSolarSystemByID(locationID)
                : station.SolarSystem;

            FullLocation = station == null
                ? SolarSystem == null
                    ? location
                    : SolarSystem.FullLocation
                : station.FullLocation;

            return(station == null
                ? SolarSystem == null
                    ? location
                    : SolarSystem.Name
                : station.Name);
        }
Esempio n. 2
0
 /// <summary>
 /// Updates the location.
 /// </summary>
 /// <returns></returns>
 public void UpdateLocation()
 {
     // If location not already determined
     if (m_locationID != 0L && (m_solarSystem == null || m_solarSystem.ID == 0 ||
                                m_fullLocation.IsEmptyOrUnknown()))
     {
         var station = EveIDToStation.GetIDToStation(m_locationID, m_character);
         if (station == null)
         {
             SolarSystem sys;
             if (m_locationID < int.MaxValue && (sys = StaticGeography.
                                                       GetSolarSystemByID((int)m_locationID)) != null)
             {
                 // In space
                 m_solarSystem  = sys;
                 m_fullLocation = sys.FullLocation;
             }
             else
             {
                 // In an inaccessible citadel, or one that is not yet loaded
                 m_solarSystem  = new SolarSystem();
                 m_fullLocation = EveMonConstants.UnknownText;
             }
         }
         else
         {
             // Station known
             m_solarSystem  = station.SolarSystem;
             m_fullLocation = station.FullLocation;
         }
         string locationStr = m_locationID.ToString(CultureConstants.InvariantCulture);
         Location = (station == null ? (m_solarSystem == null ? locationStr :
                                        m_solarSystem.Name) : station.Name);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Populates the serialization object job with the info from the API.
        /// </summary>
        /// <param name="src">The source.</param>
        private void PopulateJobInfo(SerializableJobListItem src)
        {
            ID             = src.JobID;
            InstallerID    = src.InstallerID;
            InstalledItem  = StaticBlueprints.GetBlueprintByID(src.BlueprintTypeID);
            Runs           = src.Runs;
            SolarSystem    = StaticGeography.GetSolarSystemByID(src.SolarSystemID);
            Cost           = src.Cost;
            Probability    = src.Probability;
            SuccessfulRuns = src.SuccessfulRuns;
            //InstalledTime = src.InstallTime;
            //InstalledME = src.InstalledItemMaterialLevel;
            //InstalledPE = src.InstalledItemProductivityLevel;
            StartDate = src.StartDate;
            EndDate   = src.EndDate;
            PauseDate = src.PauseDate;
            IssuedFor = src.IssuedFor;
            m_installedItemLocationID = src.StationID;

            UpdateInstallation();

            if (Enum.IsDefined(typeof(BlueprintActivity), src.ActivityID))
            {
                Activity = (BlueprintActivity)Enum.ToObject(typeof(BlueprintActivity), src.ActivityID);
            }

            OutputItem = GetOutputItem(src.ProductTypeID);

            //if (Enum.IsDefined(typeof(BlueprintType), src.InstalledItemCopy))
            //    BlueprintType = (BlueprintType)Enum.ToObject(typeof(BlueprintType), src.InstalledItemCopy);
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PlanetaryColony"/> class.
        /// </summary>
        /// <param name="ccpCharacter">The CCP character.</param>
        /// <param name="src">The source.</param>
        internal PlanetaryColony(CCPCharacter ccpCharacter, SerializablePlanetaryColony src)
        {
            Character      = ccpCharacter;
            SolarSystem    = StaticGeography.GetSolarSystemByID(src.SolarSystemID);
            PlanetID       = src.PlanetID;
            PlanetName     = src.PlanetName;
            PlanetTypeID   = src.PlanetTypeID;
            PlanetTypeName = src.PlanetTypeName;
            LastUpdate     = src.LastUpdate;
            UpgradeLevel   = src.UpgradeLevel;
            NumberOfPins   = src.NumberOfPins;

            GetColonyLayout();
        }
Esempio n. 5
0
        /// <summary>
        /// Constructor from the API.
        /// </summary>
        /// <param name="character">The character.</param>
        /// <param name="src">The source.</param>
        internal KillLog(Character character, SerializableKillLogListItem src)
        {
            Character     = character;
            KillTime      = src.KillTime;
            TimeSinceKill = DateTime.UtcNow.Subtract(src.KillTime);
            MoonID        = src.MoonID;
            Victim        = src.Victim;
            Attackers     = src.Attackers;
            SolarSystem   = StaticGeography.GetSolarSystemByID(src.SolarSystemID);

            m_items.AddRange(src.Items.Select(item => new KillLogItem(item)));

            Group = src.Victim.ID == character.CharacterID ? KillGroup.Losses : KillGroup.Kills;
        }
Esempio n. 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PlanetaryColony"/> class.
        /// </summary>
        /// <param name="ccpCharacter">The CCP character.</param>
        /// <param name="src">The source.</param>
        internal PlanetaryColony(CCPCharacter ccpCharacter, EsiPlanetaryColonyListItem src)
        {
            Character      = ccpCharacter;
            SolarSystem    = StaticGeography.GetSolarSystemByID(src.SolarSystemID);
            PlanetID       = src.PlanetID;
            PlanetTypeID   = src.PlanetType;
            PlanetTypeName = StaticItems.GetItemName(PlanetTypeID);
            PlanetName     = SolarSystem.FindPlanetByID(PlanetID)?.Name ?? EveMonConstants.
                             UnknownText;
            LastUpdate       = src.LastUpdate;
            UpgradeLevel     = src.UpgradeLevel;
            NumberOfPins     = src.NumberOfPins;
            m_layoutResponse = null;

            GetColonyLayout();
        }
Esempio n. 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PlanetaryColony"/> class.
        /// </summary>
        /// <param name="ccpCharacter">The CCP character.</param>
        /// <param name="src">The source.</param>
        internal PlanetaryColony(CCPCharacter ccpCharacter, SerializablePlanetaryColony src)
        {
            Character        = ccpCharacter;
            SolarSystem      = StaticGeography.GetSolarSystemByID(src.SolarSystemID);
            PlanetID         = src.PlanetID;
            PlanetTypeID     = src.PlanetTypeID;
            PlanetTypeName   = src.PlanetTypeName;
            PlanetName       = EveMonConstants.UnknownText;
            LastUpdate       = src.LastUpdate;
            UpgradeLevel     = src.UpgradeLevel;
            NumberOfPins     = src.NumberOfPins;
            m_layoutResponse = m_planetResponse = null;

            GetColonyLayout();
            GetPlanetName();
        }