Beispiel #1
0
 public void IsDozensWin(SpinWheel spinWheel, Board[,] rouletteBoard, Dozen dozenBet)
 {
     if (rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number >= 1 &&
         rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number <= 12 && dozenBet.dozen == 1)
     {
         Console.WriteLine("Your dozen bet won");
     }
     else if (rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number >= 13 &&
              rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number <= 24 && dozenBet.dozen == 2)
     {
         Console.WriteLine("Your dozen bet won");
     }
     else if (rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number >= 25 &&
              rouletteBoard[spinWheel.winningColumn, spinWheel.winningRow].number <= 36 && dozenBet.dozen == 3)
     {
         Console.WriteLine("Your dozen bet won");
     }
     else
     {
         Console.WriteLine("Your dozen bet didnt win");
     }
 }
Beispiel #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);
        }