/// <summary> ///Chooses the bot's move if it has a "ThreeOfAKind", "Straight", "FullHouse", "Flush", "FourOfAKind" or "StraightFlush" combination - not sure about the combinations??? /// </summary> /// <param name="character">The character.</param> /// <param name="botChips">The bot chips.</param> /// <param name="isBotsTurn">if set to <c>true</c> [is bots turn].</param> /// <param name="botFolds">if set to <c>true</c> [bot folds].</param> /// <param name="botStatus">The bot status.</param> /// <param name="botIndex">Index of the bot.</param> /// <param name="behaviourFactor">The behaviour factor.</param> /// <param name="r">The r.</param> private void ChooseBotsMoveThirdWay(ICharacter character, ref int botChips, ref bool isBotsTurn, ref bool botFolds, Label botStatus, int botIndex, int behaviourFactor, int r, int callSum) { Random randomCombination = new Random(); int combination = randomCombination.Next(1, 3); if (call <= 0) { character.ChangeStatusToChecking(); } else { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactor)) { if (botChips > call) { character.Call(callSum); } else if (botChips <= call) { isRaising = false; isBotsTurn = false; botChips = 0; botStatus.Text = "Call " + botChips; potChips.Text = (int.Parse(potChips.Text) + botChips).ToString(); } } else { if (raise > 0) { if (botChips >= raise * 2) { raise *= 2; character.RaiseBet(ref botChips, ref isBotsTurn, botStatus, potChips); } else { character.Call(callSum); } } else { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, botStatus, potChips); } } } if (botChips <= 0) { botFolds = true; } }
/// <summary> /// /// </summary> /// <param name="character"></param> /// <param name="botChips"></param> /// <param name="isBotsTurn"></param> /// <param name="labelStatus"></param> private void FixCall(ICharacter character, ref int botChips, ref bool isBotsTurn, Label labelStatus, int callSum) { if (rounds != 4) { if (labelStatus.Text.Contains("Raise")) { character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus, potChips); } if (labelStatus.Text.Contains("Call")) { character.Call(callSum); } if (labelStatus.Text.Contains("Check")) { character.ChangeStatusToChecking(); } } }
/// <summary> ///Chooses the bot's move if it has a "Pair" in the hand or "Two pairs" combinations - not sure about the combinations??? /// </summary> /// <param name="character">The character.</param> /// <param name="botChips">The bot chips.</param> /// <param name="isBotsTurn">if set to <c>true</c> [is bots turn].</param> /// <param name="botFolds">if set to <c>true</c> [bot folds].</param> /// <param name="labelStatus">The label status.</param> /// <param name="raiseBehaviourFactor">The raise behaviour factor.</param> /// <param name="behaviourFactorBasedOnBotPower">The behaviour factor based on bot power.</param> /// <param name="callBehaviourFactor">The call behaviour factor.</param> private void ChooseBotsMoveSecondWay(ICharacter character, ref int botChips, ref bool isBotsTurn, ref bool botFolds, Label labelStatus, int raiseBehaviourFactor, int behaviourFactorBasedOnBotPower, int callBehaviourFactor, int callSum) { Random pairsRandom = new Random(); int randomNumber = pairsRandom.Next(1, 3); if (rounds < 2) { if (call <= 0) { character.ChangeStatusToChecking(); } if (call > 0) { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactorBasedOnBotPower)) { character.Fold(labelStatus); } if (raise > CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor)) { character.Fold(labelStatus); } if (!botFolds) { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor) && call <= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactorBasedOnBotPower)) { character.Call(callSum); } if (raise <= CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor) && raise >= (CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor)) / 2) { character.Call(callSum); } if (raise <= (CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor)) / 2) { if (raise > 0) { raise = CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor); character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus, potChips); } else { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus, potChips); } } } } } if (rounds >= 2) { if (call > 0) { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactorBasedOnBotPower - randomNumber)) { character.Fold(labelStatus); } if (raise > CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber)) { character.Fold(labelStatus); } if (!botFolds) { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber) && call <= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactorBasedOnBotPower - randomNumber)) { character.Call(callSum); } if (raise <= CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber) && raise >= (CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber)) / 2) { character.Call(callSum); } if (raise <= (CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber)) / 2) { if (raise > 0) { raise = CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber); character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus, potChips); } else { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus, potChips); } } } } if (call <= 0) { raise = CalculateMaximumBidAbilityOfTheBot(botChips, callBehaviourFactor - randomNumber); character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus, potChips); } } if (botChips <= 0) { botFolds = true; } }
public void CallAction(ICharacter character, int call, ISingleBet bet) { character.HasRaised = false; character.Call(call); bet.AddBet(call); }
/// <summary> /// Chooses the bot's move if it has a "High Card" or "Pair" from table combination /// </summary> /// <param name="character">The character.</param> /// <param name="botChips">The bot chips.</param> /// <param name="isBotsTurn">if set to <c>true</c> [is bots turn].</param> /// <param name="botFolds">if set to <c>true</c> [bot folds].</param> /// <param name="statusLabel">The status label.</param> /// <param name="botPower">The bot power.</param> /// <param name="carefulBehaviourFactor">The careful behaviour factor.</param> /// <param name="riskyBehaviourFactor">The risky behaviour factor.</param> private void ChooseBotsMoveFirstWay(ICharacter character, ref int botChips, ref bool isBotsTurn, ref bool botFolds, Label statusLabel, double botPower, int carefulBehaviourFactor, int riskyBehaviourFactor, int callSum) { Random botHighCardPairRandom = new Random(); int botHighCardRandom = botHighCardPairRandom.Next(1, 4); if (call <= 0) { character.ChangeStatusToChecking(); } else if (call > 0) { if (botHighCardRandom == 1) { if (call <= CalculateMaximumBidAbilityOfTheBot(botChips, carefulBehaviourFactor)) { character.Call(callSum); } else { character.Fold(statusLabel); } } if (botHighCardRandom == 2) { if (call <= CalculateMaximumBidAbilityOfTheBot(botChips, riskyBehaviourFactor)) { character.Call(callSum); } else { character.Fold(statusLabel); } } } if (botHighCardRandom == 3) { if (raise == 0) { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, statusLabel, potChips); } else { if (raise <= CalculateMaximumBidAbilityOfTheBot(botChips, carefulBehaviourFactor)) { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, statusLabel, potChips); } else { character.Fold(statusLabel); } } } if (botChips <= 0) { botFolds = true; } }
/// <summary> ///Chooses the bot's move if it has a "ThreeOfAKind", "Straight", "FullHouse", "Flush", "FourOfAKind" or "StraightFlush" combination - not sure about the combinations??? /// </summary> /// <param name="character">The character.</param> /// <param name="botChips">The bot chips.</param> /// <param name="isBotsTurn">if set to <c>true</c> [is bots turn].</param> /// <param name="botFolds">if set to <c>true</c> [bot folds].</param> /// <param name="botStatus">The bot status.</param> /// <param name="botIndex">Index of the bot.</param> /// <param name="behaviourFactor">The behaviour factor.</param> /// <param name="r">The r.</param> private void ChooseBotsMoveThirdWay(ICharacter character, ref int botChips, ref bool isBotsTurn, ref bool botFolds, Label botStatus, int botIndex, int behaviourFactor, int r) { Random randomCombination = new Random(); int combination = randomCombination.Next(1, 3); if (call <= 0) { character.ChangeStatusToChecking(ref isBotsTurn, botStatus); } else { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactor)) { if (botChips > call) { character.Call(ref botChips, ref isBotsTurn, botStatus); } else if (botChips <= call) { isRaising = false; isBotsTurn = false; botChips = 0; botStatus.Text = "Call " + botChips; potChips.Text = (int.Parse(potChips.Text) + botChips).ToString(); } } else { if (raise > 0) { if (botChips >= raise * 2) { raise *= 2; character.RaiseBet(ref botChips, ref isBotsTurn, botStatus); } else { character.Call(ref botChips, ref isBotsTurn, botStatus); } } else { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, botStatus); } } } if (botChips <= 0) { botFolds = true; } }
/// <summary> /// /// </summary> /// <param name="character"></param> /// <param name="botChips"></param> /// <param name="isBotsTurn"></param> /// <param name="labelStatus"></param> private void FixCall(ICharacter character, ref int botChips, ref bool isBotsTurn, Label labelStatus) { if (rounds != 4) { if (labelStatus.Text.Contains("Raise")) { character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus); } if (labelStatus.Text.Contains("Call")) { character.Call(ref botChips, ref isBotsTurn, labelStatus); } if (labelStatus.Text.Contains("Check")) { character.ChangeStatusToChecking(ref isBotsTurn, labelStatus); } } }
/// <summary> ///Chooses the bot's move if it has a "Pair" in the hand or "Two pairs" combinations - not sure about the combinations??? /// </summary> /// <param name="character">The character.</param> /// <param name="botChips">The bot chips.</param> /// <param name="isBotsTurn">if set to <c>true</c> [is bots turn].</param> /// <param name="botFolds">if set to <c>true</c> [bot folds].</param> /// <param name="labelStatus">The label status.</param> /// <param name="raiseBehaviourFactor">The raise behaviour factor.</param> /// <param name="behaviourFactorBasedOnBotPower">The behaviour factor based on bot power.</param> /// <param name="callBehaviourFactor">The call behaviour factor.</param> private void ChooseBotsMoveSecondWay(ICharacter character, ref int botChips, ref bool isBotsTurn, ref bool botFolds, Label labelStatus, int raiseBehaviourFactor, int behaviourFactorBasedOnBotPower, int callBehaviourFactor) { Random pairsRandom = new Random(); int randomNumber = pairsRandom.Next(1, 3); if (rounds < 2) { if (call <= 0) { character.ChangeStatusToChecking(ref isBotsTurn, labelStatus); } if (call > 0) { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactorBasedOnBotPower)) { character.Fold(ref isBotsTurn, ref botFolds, labelStatus); } if (raise > CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor)) { character.Fold(ref isBotsTurn, ref botFolds, labelStatus); } if (!botFolds) { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor) && call <= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactorBasedOnBotPower)) { character.Call(ref botChips, ref isBotsTurn, labelStatus); } if (raise <= CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor) && raise >= (CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor)) / 2) { character.Call(ref botChips, ref isBotsTurn, labelStatus); } if (raise <= (CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor)) / 2) { if (raise > 0) { raise = CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor); character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus); } else { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus); } } } } } if (rounds >= 2) { if (call > 0) { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactorBasedOnBotPower - randomNumber)) { character.Fold(ref isBotsTurn, ref botFolds, labelStatus); } if (raise > CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber)) { character.Fold(ref isBotsTurn, ref botFolds, labelStatus); } if (!botFolds) { if (call >= CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber) && call <= CalculateMaximumBidAbilityOfTheBot(botChips, behaviourFactorBasedOnBotPower - randomNumber)) { character.Call(ref botChips, ref isBotsTurn, labelStatus); } if (raise <= CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber) && raise >= (CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber)) / 2) { character.Call(ref botChips, ref isBotsTurn, labelStatus); } if (raise <= (CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber)) / 2) { if (raise > 0) { raise = CalculateMaximumBidAbilityOfTheBot(botChips, raiseBehaviourFactor - randomNumber); character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus); } else { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus); } } } } if (call <= 0) { raise = CalculateMaximumBidAbilityOfTheBot(botChips, callBehaviourFactor - randomNumber); character.RaiseBet(ref botChips, ref isBotsTurn, labelStatus); } } if (botChips <= 0) { botFolds = true; } }
/// <summary> /// Chooses the bot's move if it has a "High Card" or "Pair" from table combination /// </summary> /// <param name="character">The character.</param> /// <param name="botChips">The bot chips.</param> /// <param name="isBotsTurn">if set to <c>true</c> [is bots turn].</param> /// <param name="botFolds">if set to <c>true</c> [bot folds].</param> /// <param name="statusLabel">The status label.</param> /// <param name="botPower">The bot power.</param> /// <param name="carefulBehaviourFactor">The careful behaviour factor.</param> /// <param name="riskyBehaviourFactor">The risky behaviour factor.</param> private void ChooseBotsMoveFirstWay(ICharacter character, ref int botChips, ref bool isBotsTurn, ref bool botFolds, Label statusLabel, double botPower, int carefulBehaviourFactor, int riskyBehaviourFactor) { Random botHighCardPairRandom = new Random(); int botHighCardRandom = botHighCardPairRandom.Next(1, 4); if (call <= 0) { character.ChangeStatusToChecking(ref isBotsTurn, statusLabel); } else if (call > 0) { if (botHighCardRandom == 1) { if (call <= CalculateMaximumBidAbilityOfTheBot(botChips, carefulBehaviourFactor)) { character.Call(ref botChips, ref isBotsTurn, statusLabel); } else { character.Fold(ref isBotsTurn, ref botFolds, statusLabel); } } if (botHighCardRandom == 2) { if (call <= CalculateMaximumBidAbilityOfTheBot(botChips, riskyBehaviourFactor)) { character.Call(ref botChips, ref isBotsTurn, statusLabel); } else { character.Fold(ref isBotsTurn, ref botFolds, statusLabel); } } } if (botHighCardRandom == 3) { if (raise == 0) { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, statusLabel); } else { if (raise <= CalculateMaximumBidAbilityOfTheBot(botChips, carefulBehaviourFactor)) { raise = call * 2; character.RaiseBet(ref botChips, ref isBotsTurn, statusLabel); } else { character.Fold(ref isBotsTurn, ref botFolds, statusLabel); } } } if (botChips <= 0) { botFolds = true; } }