public void DoubleRowBet(DoubleRows doubleRowBet)//todo fix so you cant pick rows that arent next to each other { int bet = 0; int bet2 = 12; do { try { Console.WriteLine("Enter the row you would like to bet on (use 1-12)"); bet = int.Parse(Console.ReadLine()); Console.WriteLine("Enter the second row you would like to bet on (use 1-12, this row must be next to your first row)"); bet2 = int.Parse(Console.ReadLine()); } catch (FormatException e) { Console.WriteLine("Please try again."); } catch (OverflowException e) { Console.WriteLine("Please try again."); } } while (((bet <= 0 || bet > 12) && (bet2 <= 0 || bet2 > 12)) || (bet + 1 != bet2 && bet - 1 != bet2)); doubleRowBet.row1 = bet; doubleRowBet.row2 = bet2; }
public void IsDoubleRowsWin(SpinWheel spinWheel, DoubleRows doubleRowBet) { if (spinWheel.winningRow + 1 == doubleRowBet.row1 || spinWheel.winningRow + 1 == doubleRowBet.row2) { Console.WriteLine("Your double row bet won"); } else { Console.WriteLine("Your double row bet didnt win"); } }
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); }