Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="playerID"></param>
        /// <param name="nickname"></param>
        /// <returns>Last FaceitMatch</returns>
        public FaceitLastMatch[] getFaceitLastMatchDetails(string playerID, string nickname)
        {
            var model      = new Faceitmatch();
            var _faceitApi = new Faceitapi();

            FaceitLastMatch[] LastMatch = _faceitApi.getFaceitHistory(playerID);

            return(LastMatch);
        }
Exemple #2
0
        /// <summary>
        /// Get FaceitAvg Stats with the historyLength and the calculationLength
        /// </summary>
        /// <param name="faceitId"></param>
        /// <param name="historyLength"></param>
        /// <param name="calculationLength"></param>
        /// <returns></returns>
        public FaceitUserStats FaceitAvgElo(string faceitId, int historyLength = 50, int calculationLength = 20)
        {
            int count      = 0;
            var userStats  = new FaceitUserStats();
            var _faceitApi = new Faceitapi();

            FaceitLastMatch[] UserHistory = _faceitApi.getFaceitHistory(faceitId, historyLength);   //get Object of all Matches

            foreach (dynamic Matches in UserHistory)
            {
                if (Matches.gameMode == "5v5")
                {
                    count++;
                    userStats = getSumOfStats(Matches, userStats);

                    if (count >= calculationLength)
                    {
                        break;
                    }
                }
            }
            userStats = getAvgStats(userStats, count);
            return(userStats);
        }