Esempio n. 1
0
    // Start is called before the first frame update
    private void Awake()
    {
        Screen.orientation = ScreenOrientation.Portrait;
        instance           = this;
        TryAgainButton.SetActive(false);
        RollButton.SetActive(true);
        planner.GetComponent <BoxCollider>().enabled = false;

        userName.text     = UserDetailsManager.userName;
        coins.text        = UserDetailsManager.userCoins.ToString();
        gamePlayText.text = UserDetailsManager.userName;
    }
Esempio n. 2
0
    public void btnBet_Click(object sender, EventArgs e)
    {
        ErrorMessagePanel.Visible = false;
        ErrorMessage.Text         = "";

        try
        {
            AppSettings.Reload();
            var TheButton = (Button)sender;

            Money   maxProfit = Money.MultiplyPercent(siteInvestment, AppSettings.DiceGame.MaxBitCoinProfitPercent);
            Money   minBet    = AppSettings.DiceGame.MinBitCoinBet;
            decimal maxChance = AppSettings.DiceGame.MaxChance;

            decimal formChance    = Convert.ToDecimal(chanceTextBox.Text);
            Money   formBetAmount = Money.Parse(betAmountTextBox.Text);
            int     houseEdge     = AppSettings.DiceGame.HouseEdgePercent;
            Money   formProfit    = Money.Parse(profitTextBox.Text);
            bool    low           = Convert.ToBoolean(TheButton.CommandArgument);

            DiceGameManager.TryToBet(maxProfit, minBet, formChance, formBetAmount, houseEdge, formProfit, low);

            MyBetsGridView.DataBind();
            siteInvestment          = SiteInvestmentManager.GetCurrentBankroll();
            sitesBankrollLabel.Text = siteInvestment.ToClearString();
            maxProfitLabel.Text     = Money.MultiplyPercent(siteInvestment, AppSettings.DiceGame.MaxBitCoinProfitPercent).ToClearString();
            adBalanceLabel.Text     = Member.Current.PurchaseBalance.ToClearString();
        }
        catch (MsgException ex)
        {
            ErrorMessagePanel.Visible = true;
            ErrorMessage.Text         = ex.Message;
        }
        catch (Exception ex)
        {
            ErrorLogger.Log(ex);
            throw ex;
        }
    }
Esempio n. 3
0
    private void GetStatsData()
    {
        var userWins   = DiceGameManager.GetTotalWinsLosses(isWin: true, userId: user.Id);
        var userLosses = DiceGameManager.GetTotalWinsLosses(isWin: false, userId: user.Id);
        var userBets   = userWins + userLosses;

        UsersBetsLiteral.Text = userBets.ToString();

        var siteWins   = DiceGameManager.GetTotalWinsLosses(isWin: true);
        var siteLosses = DiceGameManager.GetTotalWinsLosses(isWin: false);
        var siteBets   = siteWins + siteLosses;

        SitesBetsLiteral.Text = siteBets.ToString();

        UsersWageredLiteral.Text = DiceGameManager.GetTotalWagered(user.Id).ToString();
        SitesWageredLiteral.Text = DiceGameManager.GetTotalWagered().ToString();
        UsersWinsLiteral.Text    = userWins.ToString();
        SitesWinsLiteral.Text    = siteWins.ToString();
        UsersLossesLiteral.Text  = userLosses.ToString();
        SitesLossesLiteral.Text  = siteLosses.ToString();
        UsersProfitLiteral.Text  = DiceGameManager.GetTotalProfit(user.Id).ToString();
        SitesProfitLiteral.Text  = DiceGameManager.GetTotalProfit().ToString();
    }