Exemple #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());
    }
    /// <summary>
    ///
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public IEnumerator GetSummonerInformation()
    {
        string url = "";

        string[] summonerNames = { summonerName.text };

        Region.RegionEnum region = (Region.RegionEnum)Enum.Parse(typeof(Region.RegionEnum), regionDropDown.options[regionDropDown.value].text.ToLower());

        if (Application.isWebPlayer)
        {
            url = "UrfQuest.php?apiCall=" + RiotAPIConstants.SUMMONERIDS_FROM_SUMMONER_NAME(summonerNames, region);
        }
        else
        {
            url = RiotAPIConstants.SUMMONERIDS_FROM_SUMMONER_NAME(summonerNames, region);
        }

        Fetch fetch = new Fetch(GetSummonerInformationSuccess,
                                GetSummonerInformationFailure,
                                url,
                                Summoner.fromJSON
                                );

        return(fetch.WaitForUrlData());
    }
Exemple #3
0
    private IEnumerator GrabChampionIcon(string championName)
    {
        //string url = RiotAPIConstants.CHAMPION_ICON_HYPERLINK(championName);
        string url = RiotAPIConstants.CHAMPION_PORTRAIT_HYPERLINK(championName);
        WWW    www = new WWW(url);

        yield return(www);

        renderer.material.mainTexture = www.texture;
    }
Exemple #4
0
    public IEnumerator getMasteryInformation(Summoner summoner)
    {
        //string url = RiotAPIConstants.CHAMPIONMASTERY_TOP_CHAMPIONS(summoner.ID);
        //string url = RiotAPIConstants.CHAMPIONMASTERY_ALL_CHAMPIONS(summoner.ID);
        string url = RiotAPIConstants.CHAMPIONMASTERY_SINGLE_CHAMPION(summoner.ID, 133);

        Fetch fetch = new Fetch(masterySuccess,
                                masteryFailure,
                                url,
                                ChampionMastery.fromJSON
                                );

        return(fetch.WaitForUrlData());
    }
Exemple #5
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public IEnumerator GetChampionByID(int championID)
    {
        //Fetch fetch = new Fetch(success, failure, RiotAPIConstants.MATCHv2_2(Region.NorthAmerica, 1787569113), MatchDetail.fromJSON);
        string url = "";

        if (Application.isWebPlayer)
        {
            url = "UrfQuest.php?apiCall=" + RiotAPIConstants.CHAMPION_STATIC_DATA(championID, ChampData.image, Region.RegionEnum.na);
        }
        else
        {
            url = RiotAPIConstants.CHAMPION_STATIC_DATA(championID, ChampData.image, Region.RegionEnum.na);
        }

        Fetch fetch = new Fetch(success, failure, url, Champion.fromJSON);

        return(fetch.WaitForUrlData());
    }
Exemple #6
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public IEnumerator getMatchIDList(System.DateTime date)
    {
        string url = "";

        if (Application.isWebPlayer)
        {
            url = "UrfQuest.php?apiCall=" + RiotAPIConstants.API_CHALLENGE_MATCH_LIST(Region.RegionEnum.na, EpochTime.ToEpoch(date));
        }
        else
        {
            url = RiotAPIConstants.API_CHALLENGE_MATCH_LIST(Region.RegionEnum.na, EpochTime.ToEpoch(date));
        }

        Fetch fetch = new Fetch(success,
                                failure,
                                url,
                                MatchIDList.fromJSON
                                );

        return(fetch.WaitForUrlData());
    }
Exemple #7
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public IEnumerator getSummonerInformation(string summonerName)
    {
        string url = "";

        string[] summonerNames = { summonerName };

        if (Application.isWebPlayer)
        {
            url = "UrfQuest.php?apiCall=" + RiotAPIConstants.SUMMONERIDS_FROM_SUMMONER_NAME(summonerNames);
        }
        else
        {
            url = RiotAPIConstants.SUMMONERIDS_FROM_SUMMONER_NAME(summonerNames);
        }

        Fetch fetch = new Fetch(success,
                                failure,
                                url,
                                Summoner.fromJSON
                                );

        return(fetch.WaitForUrlData());
    }
Exemple #8
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="date"></param>
    /// <returns></returns>
    public IEnumerator getMatch(long matchID)
    {
        Fetch fetch = new Fetch(MatchGrabSuccess, failure, RiotAPIConstants.MATCHv2_2(Region.RegionEnum.na, matchID), MatchDetail.fromJSON);

        return(fetch.WaitForUrlData());
    }