Esempio n. 1
0
    /// <summary>
    /// The coroutine method used to fetch the champion database.
    /// </summary>
    /// <param name="region"></param>
    /// <param name="champData"></param>
    /// <returns></returns>
    private IEnumerator InitializeChampionDatabase(Region.RegionEnum region, ChampData champData)
    {
        string url = "";

        if (Application.isWebPlayer)
        {
            url = "UrfQuest.php?apiCall=" + RiotAPIConstants.CHAMPIONv1_2(region, champData);
        }
        else
        {
            url = RiotAPIConstants.CHAMPIONv1_2(region, champData);
        }
        Fetch fetch;

        if (RiotAPIConstants.READ_FROM_FILES == true)
        {
            fetch = new Fetch(InitializationSuccess, null, ChampionDB.fromJSON);
        }
        else
        {
            fetch = new Fetch(InitializationSuccess, InitializationFailure, url, ChampionDB.fromJSON);
        }

        return(fetch.WaitForUrlData());
    }
Esempio n. 2
0
 /// <summary>
 /// Returns a champions details JSON string.
 /// </summary>
 /// <param name="id"> The champion ID. </param>
 /// <param name="region"> The region we are looking to grab from. </param>
 /// <returns>cahmpion details json string</returns>
 public static String CHAMPION_STATIC_DATA(int id = 17, ChampData champData = ChampData.minimal, Region.RegionEnum region = Region.RegionEnum.na)
 {
     // EXAMPLE: https;//global.api.pvp.net/api/lol/static-data/na/v1.2/champion/30?api_key=1069372c-3d2d-4734-964c-53434511b8f8
     if (champData == ChampData.minimal)
     {
         return(API_Prefix(region) + "static-data/" + region.ToString() + "/" + "v1.2/champion/" + id.ToString() + "&api_key=" + API_KEY_SUFFIX);
     }
     else
     {
         return(API_Prefix(region) + "static-data/" + region.ToString() + "/" + "v1.2/champion/" + id.ToString() + "?champData=" + champData.ToString() + "&api_key=" + API_KEY_SUFFIX);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Returns a Champions data Json string. The results depend upon what type of data you are requesting about the champion (See: ChampData)
 /// </summary>
 /// <param name="region"> the region you are looking to retrieve from </param>
 /// <param name="champData">the information about the champion you wish to retrieve. (See: ChampData)</param>
 /// <returns>Champion data Json string</returns>
 public static String CHAMPIONv1_2(Region.RegionEnum region, ChampData champData)
 {
     // https;//global.api.pvp.net/api/lol/static-data/na/v1.2/champion?champData=stats&api_key=API_KEY_SUFFIX
     return(Global_API_Prefix + "static-data/" + region.ToString() + "/" + "v1.2/champion?champData=" + champData.ToString() + "&api_key=" + API_KEY_SUFFIX);
 }
 public static string GetChampData(ChampData champData)
 {
     if (champData == ChampData.All)
     {
         return "all";
     }
     else if (champData == ChampData.AllyTips)
     {
         return "allytips";
     }
     else if (champData == ChampData.AltImages)
     {
         return "altimages";
     }
     else if (champData == ChampData.Blurb)
     {
         return "blurb";
     }
     else if (champData == ChampData.EnemyTips)
     {
         return "enemytips";
     }
     else if (champData == ChampData.Image)
     {
         return "image";
     }
     else if (champData == ChampData.Info)
     {
         return "info";
     }
     else if (champData == ChampData.Lore)
     {
         return "lore";
     }
     else if (champData == ChampData.Partype)
     {
         return "partype";
     }
     else if (champData == ChampData.Passive)
     {
         return "passive";
     }
     else if (champData == ChampData.Recommended)
     {
         return "recommended";
     }
     else if (champData == ChampData.Skins)
     {
         return "skins";
     }
     else if (champData == ChampData.Spells)
     {
         return "spells";
     }
     else if (champData == ChampData.Stats)
     {
         return "stats";
     }
     else if (champData == ChampData.Tags)
     {
         return "tags";
     }
     else
     {
         // None case
         return "";
     }
 }
Esempio n. 5
0
 public static string GetChampData(ChampData champData)
 {
     if (champData == ChampData.All)
     {
         return "all";
     }
     else if (champData == ChampData.AllyTips)
     {
         return "allytips";
     }
     else if (champData == ChampData.AltImages)
     {
         return "altimages";
     }
     else if (champData == ChampData.Blurb)
     {
         return "blurb";
     }
     else if (champData == ChampData.EnemyTips)
     {
         return "enemytips";
     }
     else if (champData == ChampData.Image)
     {
         return "image";
     }
     else if (champData == ChampData.Info)
     {
         return "info";
     }
     else if (champData == ChampData.Lore)
     {
         return "lore";
     }
     else if (champData == ChampData.Partype)
     {
         return "partype";
     }
     else if (champData == ChampData.Passive)
     {
         return "passive";
     }
     else if (champData == ChampData.Recommended)
     {
         return "recommended";
     }
     else if (champData == ChampData.Skins)
     {
         return "skins";
     }
     else if (champData == ChampData.Spells)
     {
         return "spells";
     }
     else if (champData == ChampData.Stats)
     {
         return "stats";
     }
     else if (champData == ChampData.Tags)
     {
         return "tags";
     }
     else
     {
         // None case
         return "";
     }
 }