Пример #1
0
        public static EveCharacter RetrieveCharacterById(string charId)
        {
            try
            {
                var loader = new EveCharacterApiService(charId);

                var character = new EveCharacter(charId, loader.Name, loader.SecurityStatus, loader.Age, loader.Corporation, loader.Alliance, GetKnownPositions(long.Parse(charId)));
                character.PropertyChanged += CharacterOnPropertyChanged;

                return(character);
            }
            catch (Exception e)
            {
                throw new CharacterRetrievalException(
                          string.Format("Could not retrieve character information for character with id: {0}", charId), e);
            }
        }
Пример #2
0
        private static void AddStandingsForPersonalCorpAndAlliance(Hashtable entries)
        {
            var eveChar = EveCharacterApiService.RetrieveCharacterById(ActiveProfile.Default.CharacterId);

            if (!entries.ContainsKey(eveChar.Corporation))
            {
                entries.Add(eveChar.Corporation, 10.0d);
            }

            if (eveChar.Alliance != null && !entries.ContainsKey(eveChar.Alliance))
            {
                entries.Add(eveChar.Alliance, 10.0d);
            }

            if (!entries.ContainsKey(eveChar.Name))
            {
                entries.Add(eveChar.Name, 10.0d);
            }
        }