public Character GetCharacterProfile(string realm, string character, CharacterFields field) { string fieldInput = field.ToString(); Request request = new Request(User_Agent); request.Get($"{Api_Url}wow/character/{realm}/{character}?fields={fieldInput}&locale={Locale}&apikey={Api_Key}"); return(new Character(JObject.Parse(request.Response))); }
public static string BuildQueryString(this CharacterFields fields) { switch (fields) { case CharacterFields.All: return("&fields=achievements,appearance,feed,guild,hunter pets,items,mounts,pets,pet slots,professions,progression,pvp,quests,reputation,statistics,stats,talents,titles,audit"); case CharacterFields.None: return(string.Empty); default: var flags = fields.ToString().ToLower(); return($"&fields={flags}"); } }
public static string BuildQueryString(this CharacterFields fields) { // The Blizzard API only accepts lowercase fields. string flags = fields.ToString().ToLower(); if (flags == "all") { return("&fields=achievements,appearance,feed,guild,hunter pets,items,mounts,pets,pet slots," + "professions,progression,pvp,quests,reputation,statistics,stats,talents,titles,audit"); } if (flags == "none") { return(string.Empty); } return($"&fields={flags}"); }