コード例 #1
0
 void SetStats(WolfBetStats Stats)
 {
     try
     {
         PropertyInfo tmp = typeof(Dice).GetProperty(CurrentCurrency.ToLower());
         if (tmp != null)
         {
             WBStat stat = tmp.GetValue(Stats.dice) as WBStat;
             if (stat != null)
             {
                 this.Stats.Bets    = int.Parse(stat.total_bets);
                 this.Stats.Wins    = int.Parse(stat.win);
                 this.Stats.Losses  = int.Parse(stat.lose);
                 this.Stats.Wagered = decimal.Parse(stat.waggered, System.Globalization.NumberFormatInfo.InvariantInfo);
                 this.Stats.Profit  = decimal.Parse(stat.profit, System.Globalization.NumberFormatInfo.InvariantInfo);
             }
         }
     }
     catch
     {
         this.Stats.Bets    = 0;
         this.Stats.Wins    = 0;
         this.Stats.Losses  = 0;
         this.Stats.Wagered = 0;
         this.Stats.Profit  = 0;
     }
 }
コード例 #2
0
ファイル: WolfBet.cs プロジェクト: dexter369/DiceBot
        void UpdateStats(WolfBetStats Stats)
        {
            PropertyInfo tmp = typeof(Dice).GetProperty(Currency.ToLower());

            if (tmp != null)
            {
                WBStat stat = tmp.GetValue(Stats.dice) as WBStat;
                if (stat != null)
                {
                    this.bets    = stat.total_bets;
                    this.wins    = int.Parse(stat.win);
                    this.losses  = int.Parse(stat.lose);
                    this.wagered = decimal.Parse(stat.waggered, System.Globalization.NumberFormatInfo.InvariantInfo);
                    this.profit  = decimal.Parse(stat.profit, System.Globalization.NumberFormatInfo.InvariantInfo);
                    Parent.updateBets(bets);
                    Parent.updateWins(wins);
                    Parent.updateLosses(losses);
                    Parent.updateWagered(wagered);
                    Parent.updateProfit(profit);
                }
            }
        }