예제 #1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            switch (info.ButtonID)
            {
            case 0: break;

            case 1:
                TextRelay tr = info.GetTextEntry(0);

                if (tr != null)
                {
                    string text = tr.Text;
                    int    bet  = Utility.ToInt32(text) * 3;

                    if (bet > 0 && bet <= (int)PointsSystem.CasinoData.GetPoints(User))
                    {
                        PointsSystem.CasinoData.DeductPoints(User, bet, false);

                        Game.CurrentBet = bet;
                        Game.Bet1       = bet / 3;
                        Game.Bet2       = bet / 3;
                        Game.Bet3       = bet / 3;

                        Game.BeginRollDice();
                    }
                    else
                    {
                        Game.Stage = GameStage.Error;
                        Refresh();
                    }
                }
                break;

            case 2:
                if (Game.RollNumber == 2)
                {
                    PointsSystem.CasinoData.AwardPoints(User, Game.Bet2);
                    Game.Bet2 = 0;
                }
                else if (Game.RollNumber == 3)
                {
                    PointsSystem.CasinoData.AwardPoints(User, Game.Bet3);
                    Game.Bet3 = 0;
                }

                Game.Stage = GameStage.Rolling;
                Game.BeginRollDice();
                break;

            case 3:
                Game.Stage = GameStage.Rolling;
                Game.BeginRollDice();
                break;

            case 4:
                Game.Reset();
                Refresh();
                break;

            case 250:
                DiceGame.Reset();
                Refresh();
                break;
            }
        }