public IEnumerable <RDeepBet> GoForBet(RDeepPlayer player, List <RDeepPosition> LastNumbers) { if (player.coins.Count < 1) { throw new Exception("Running out of coins!"); } List <RDeepBet> result = new List <RDeepBet>(); RDeepPosition maxProbableNumber = RDeepPosition.Six; float maxProbability = maxProbableNumber.defaultProbability; if (probabilities.Count < 1) { UpdateProbabilities(LastNumbers); } foreach (RDeepPosition number in wheelNumbers) { if (maxProbability < probabilities[number]) { maxProbability = probabilities[number]; maxProbableNumber = number; } } List <Coin> betCoins = new List <Coin>(); int randomTotalCoins; if (player.coins.Count(coin => coin.isOnBet == false && coin.Value <= 25) < 4) { randomTotalCoins = 1; } else { randomTotalCoins = Generic.GetRandomNumber(1, 2); } for (int i = 0; i < randomTotalCoins; i++) { List <Coin> activeCoins = player.coins.Where(coin => coin.isOnBet == false && coin.Value <= 25).ToList(); int randomCoin = Generic.GetRandomNumber(0, activeCoins.Count); activeCoins[randomCoin].isOnBet = true; betCoins.Add(activeCoins[randomCoin]); System.Threading.Thread.Sleep(100); } result.Add(new RDeepBet( player, RDeepBetPositions.GetRDeepBetPositionByPositionIDs(new int[] { maxProbableNumber.ID }), betCoins)); return(result); }
public IEnumerable <RDeepBet> GoForBetRandomBetTypes(RDeepPlayer player, List <RDeepPosition> LastNumbers) { List <RDeepBet> result = new List <RDeepBet>(); if (player.coins.Count < 1) { throw new Exception("Running out of coins!"); } int randomNoOfBets = Generic.GetRandomNumber(1, 4); for (int b = 0; b < randomNoOfBets; b++) { int BetPosition = Generic.GetRandomNumber(1, RDeepBetPositions.Total + 1); List <Coin> betCoins = new List <Coin>(); int randomTotalCoins; if (player.coins.Count < 4) { randomTotalCoins = 1; } else { randomTotalCoins = Generic.GetRandomNumber(1, 2); } for (int i = 0; i < randomTotalCoins; i++) { List <Coin> activeCoins = player.coins.Where(coin => coin.isOnBet == false && coin.Value <= 5).ToList(); int randomCoin = Generic.GetRandomNumber(0, activeCoins.Count); activeCoins[randomCoin].isOnBet = true; betCoins.Add(activeCoins[randomCoin]); System.Threading.Thread.Sleep(100); } result.Add(new RDeepBet( player, RDeepBetPositions.GetRDeepBetPositionByID(BetPosition), betCoins)); if (player.coins.Count == 0) { break; } System.Threading.Thread.Sleep(150); } return(result); }
private void ValidateBetsForPlayers() { foreach (RDeepBet bet in bets) { if (RDeepBetPositions.ValidateBet(bet.BetPosition, CurrentNumber.ID)) { bet.status = BetStatus.Won; } else { bet.status = BetStatus.Lost; } } }
public IEnumerable <RDeepBet> GoForBet(RDeepPlayer player, List <RDeepPosition> LastNumbers) { List <RDeepBet> result = new List <RDeepBet>(); int randomWheelNumber = 7; randomWheelNumber = Generic.GetRandomNumber(0, 38); if (player.coins.Count(coin => coin.isOnBet == false && coin.Value <= 25) < 1) { throw new Exception("Running out of coins!"); } List <Coin> betCoins = new List <Coin>(); int randomTotalCoins; if (player.coins.Count < 4) { randomTotalCoins = 1; } else { randomTotalCoins = Generic.GetRandomNumber(1, 2); } for (int i = 0; i < randomTotalCoins; i++) { List <Coin> activeCoins = player.coins.Where(coin => coin.isOnBet == false && coin.Value <= 25).ToList(); int randomCoin = Generic.GetRandomNumber(0, activeCoins.Count); activeCoins[randomCoin].isOnBet = true; betCoins.Add(activeCoins[randomCoin]); System.Threading.Thread.Sleep(100); } result.Add(new RDeepBet( player, RDeepBetPositions.GetRDeepBetPositionByPositionIDs(new int[] { randomWheelNumber }), betCoins)); return(result); }
private static RDeepBetTypeWiningNumbersList LoadBetTypeWiningNumbersList(BetTypes bet) { List <int[]> BetTypeWiningNumbersList = new List <int[]>(); int Factor = 0; if (bet == BetTypes.StraightUp) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37 } }; Factor = 35; } else if (bet == BetTypes.Row || bet == BetTypes.Split) { BetTypeWiningNumbersList = RDeepBetPositions.GetBetPositions(bet); Factor = 17; } else if (bet == BetTypes.Street) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 0, 1, 2, }, //0, 1, 2 new int[] { 37, 2, 3, }, //00, 2, 3 new int[] { 1, 2, 3, }, new int[] { 4, 5, 6, }, new int[] { 7, 8, 9 }, new int[] { 10, 11, 12 }, new int[] { 13, 14, 15 }, new int[] { 16, 17, 18 }, new int[] { 19, 20, 21 }, new int[] { 22, 23, 24 }, new int[] { 28, 29, 30 }, new int[] { 31, 32, 33 }, new int[] { 34, 35, 36 } }; Factor = 11; } else if (bet == BetTypes.Corner) { BetTypeWiningNumbersList = RDeepBetPositions.GetBetPositions(bet); Factor = 8; } else if (bet == BetTypes.TopLineOrBasket) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 0, 37, 2, 3 }, //"0, 00, 1, 2, 3" }; Factor = 6; } else if (bet == BetTypes.SixLine) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 0, 37, 1, 2, 3 }, //0, 00, 1, 2, 3 new int[] { 1, 2, 3, 4, 5, 6 }, new int[] { 4, 5, 6, 7, 8, 9 }, new int[] { 7, 8, 9, 10, 11, 12 }, new int[] { 10, 11, 12, 13, 14, 15 }, new int[] { 13, 14, 15, 16, 17, 18 }, new int[] { 16, 17, 18, 19, 20, 21 }, new int[] { 19, 20, 21, 22, 23, 24 }, new int[] { 22, 23, 24, 25, 26, 27 }, new int[] { 25, 26, 27, 28, 29, 30 }, new int[] { 28, 29, 30, 31, 32, 33 }, new int[] { 31, 32, 33, 34, 35, 36 } }; Factor = 6; } else if (bet == BetTypes.FirstDozen) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 } // 1 to 12 }; Factor = 2; } else if (bet == BetTypes.SecondDozen) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 } // 13 to 24 }; Factor = 2; } else if (bet == BetTypes.ThirdDozen) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 } // 25 to 36 }; Factor = 2; } else if (bet == BetTypes.FirstColumn) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34 } // }; Factor = 2; } else if (bet == BetTypes.SecondColumn) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35 } // }; Factor = 2; } else if (bet == BetTypes.ThirdColumn) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36 } // }; Factor = 2; } else if (bet == BetTypes.Odd) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35 } //Odd numbers 1, 3, 5 .... 35 }; Factor = 1; } else if (bet == BetTypes.Even) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36 } //Even numbers 2, 4, 6 .... 36 }; Factor = 1; } else if (bet == BetTypes.Red) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36 } }; Factor = 1; } else if (bet == BetTypes.Black) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35 } }; Factor = 1; } else if (bet == BetTypes.OneToEighteen) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 } // 1 to 18 }; Factor = 1; } else if (bet == BetTypes.NinteenToThirtyEight) { BetTypeWiningNumbersList = new List <int[]> { new int[] { 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 } // 19 to 36 }; Factor = 1; } return(new RDeepBetTypeWiningNumbersList(Factor, bet, BetTypeWiningNumbersList)); }
private void LoadBoardBetPositions() { RDeepPositions RDeepPositions = new RDeepPositions(); RDeepBetPositions betPos = new RDeepBetPositions(); RDeepWiningNumbersList betWinPos = new RDeepWiningNumbersList(); }
public static bool ValidateBet(int BetPositionID, int CurrentNumber) { RDeepBetPosition RDeepBetPosition = RDeepBetPositions.GetRDeepBetPositionByID(BetPositionID); return(ValidateBet(RDeepBetPosition, CurrentNumber)); }