Exemple #1
0
        public Character GetCharacter(string realmName, string characterName, OptionalCharInformation optionalInformation)
        {
            this.GetCharacterClasses();
            this.GetCharacterRaces();

            string characterUrl = UrlHelper.GetCharacterUrl(realmName, characterName, optionalInformation);
            Character searchedChar = JsonHelper.DeserializeData<Character>(this.WebClient, characterUrl);

            return searchedChar;
        }
Exemple #2
0
        /// <summary>
        /// Returns the Query to a specific Character
        /// </summary>
        /// <param name="realmName"></param>
        /// <param name="characterName"></param>
        /// <returns></returns>
        internal static string GetCharacterUrl(string realmName, string characterName, OptionalCharInformation opInfo)
        {
            string baseQuery = string.Format(CharacterConstants.CHAR_URL, realmName, characterName);
            StringBuilder optionalBuilder = new StringBuilder(64);

            if (opInfo == OptionalCharInformation.None)
                return baseQuery;

            foreach (OptionalCharInformation info in Enum.GetValues(typeof(OptionalCharInformation)))
            {
                if ((opInfo & info) == info)
                    optionalBuilder.AppendFormat("{0},", EnumHelper.GetDisplayName<OptionalCharInformation>(info));
            }

            return string.Format(CharacterConstants.CHAR_OPTIONAL_URL, baseQuery, optionalBuilder.ToString());
        }