Exemplo n.º 1
0
 public void IsRedBlackWin(SpinWheel spinWheel, ColorBet colorBet, Board[,] rouletteBoard)
 {
     if (colorBet.colorBettingOn == 1 && rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].color.Equals("R"))
     {
         Console.WriteLine("Your color bet on red won");
     }
     else if (colorBet.colorBettingOn == 2 && rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].color.Equals("B"))
     {
         Console.WriteLine("Your color bet on black won");
     }
     else
     {
         Console.WriteLine("Your color bet did not win");
     }
 }//works
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var                        rouletteBoard              = CreateBoard();
            Random                     rng                        = new Random();
            GetBet                     getBet                     = new GetBet();
            SpecificNumberBet          specificNumberBet          = new SpecificNumberBet();
            EvenOrOdd                  evenOrOddBet               = new EvenOrOdd();
            ColorBet                   colorBet                   = new ColorBet();
            LowHigh                    lowHighBet                 = new LowHigh();
            Dozen                      dozenBet                   = new Dozen();
            Columns                    columnBet                  = new Columns();
            Rows                       rowBet                     = new Rows();
            DoubleRows                 doubleRowBet               = new DoubleRows();
            Split                      splitBet                   = new Split();
            Corner                     cornerBet                  = new Corner();
            SpinWheel                  spinWheel                  = new SpinWheel(rng);
            DetermineWin               determineWin               = new DetermineWin();
            DisplayPossibleWinningBets displayPossibleWinningBets = new DisplayPossibleWinningBets();
            DisplayWinningBin          displayWinningBin          = new DisplayWinningBin();
            int                        categoryChoice;

            //for (int i = 0; i < 100; i++)
            //{
            //    doubleRowBet.row1= 1;
            //    doubleRowBet.row2 = 2;
            //    spinWheel.Spin();
            //    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
            //    determineWin.IsDoubleRowsWin(spinWheel, doubleRowBet);
            //    Console.ReadLine();
            //    Console.Clear();
            //}
            do
            {
                DisplayBoard(rouletteBoard);
                getBet.DisplayPossibleBets();
                categoryChoice = getBet.GetBetCategoryChoice();
                switch (categoryChoice)
                {
                case 0:
                {
                    break;
                }

                case 1:
                {
                    specificNumberBet.numberBettingOn = getBet.GetNumberBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsSpecificNumberWin(spinWheel, specificNumberBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 2:
                {
                    colorBet.colorBettingOn = getBet.GetColorBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsRedBlackWin(spinWheel, colorBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 3:
                {
                    evenOrOddBet.evenOrOdd = getBet.EvensOdds();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsEvenOddsWin(spinWheel, evenOrOddBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 4:
                {
                    lowHighBet.high = getBet.LowHighBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsLowHighWin(spinWheel, lowHighBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 5:
                {
                    dozenBet.dozen = getBet.DozensBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsDozensWin(spinWheel, rouletteBoard, dozenBet);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 6:
                {
                    columnBet.column = getBet.ColumnBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsColumnsWin(spinWheel, columnBet);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 7:
                {
                    rowBet.row = getBet.RowBet();
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsRowWin(spinWheel, rowBet);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 8:
                {
                    getBet.DoubleRowBet(doubleRowBet);
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsDoubleRowsWin(spinWheel, doubleRowBet);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 9:
                {
                    getBet.SplitBet(splitBet);
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsSplitWin(spinWheel, splitBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }

                case 10:
                {
                    getBet.CornerBet(cornerBet);
                    spinWheel.Spin();
                    displayWinningBin.DisplayResult(spinWheel, rouletteBoard);
                    determineWin.IsCornerWin(spinWheel, cornerBet, rouletteBoard);
                    displayPossibleWinningBets.DisplayPossibleWins(spinWheel, rouletteBoard);
                    break;
                }
                }
                Console.WriteLine("Hit enter to continue");
                Console.ReadLine();
                Console.Clear();
            } while (categoryChoice != 0);
        }