예제 #1
0
파일: WinDice.cs 프로젝트: josw96c/DiceBot
        bool getstats()
        {
            string          response   = Client.GetStringAsync("stats").Result;
            WDStatsResponse tmpBalance = json.JsonDeserialize <WDStatsResponse>(response);

            if (tmpBalance.data != null)
            {
                foreach (WDStatistic x in tmpBalance.data.statistics)
                {
                    if (x.curr == Currency)
                    {
                        this.wagered = x.bet;
                        this.profit  = x.profit;
                        Parent.updateWagered(wagered);
                        Parent.updateProfit(profit);

                        break;
                    }
                }
                this.bets   = tmpBalance.data.stats.bets;
                this.wins   = tmpBalance.data.stats.wins;
                this.losses = tmpBalance.data.stats.loses;
                Parent.updateBets(bets);
                Parent.updateWins(wins);
                Parent.updateLosses(losses);
            }
            return(tmpBalance.status == "success");
        }
예제 #2
0
        bool getstats()
        {
            string          response   = Client.GetStringAsync("stats").Result;
            WDStatsResponse tmpBalance = json.JsonDeserialize <WDStatsResponse>(response);

            if (tmpBalance.data != null)
            {
                foreach (WDStatistic x in tmpBalance.data.statistics)
                {
                    if (x.curr == CurrentCurrency)
                    {
                        Stats.Wagered = x.bet;
                        Stats.Profit  = x.profit;

                        break;
                    }
                }
                Stats.Bets   = tmpBalance.data.stats.bets;
                Stats.Wins   = tmpBalance.data.stats.wins;
                Stats.Losses = tmpBalance.data.stats.loses;
            }
            return(tmpBalance.status == "success");
        }