本文整理汇总了C#中ICharacter.Call方法的典型用法代码示例。如果您正苦于以下问题:C# ICharacter.Call方法的具体用法?C# ICharacter.Call怎么用?C# ICharacter.Call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICharacter
的用法示例。
在下文中一共展示了ICharacter.Call方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CallAction
public void CallAction(ICharacter character, int call, ISingleBet bet)
{
character.HasRaised = false;
character.Call(call);
bet.AddBet(call);
}
示例2: ChooseBotsMoveThirdWay
/// <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;
}
}
示例3: ChooseBotsMoveSecondWay
/// <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);
//.........这里部分代码省略.........
示例4: FixCall
/// <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);
}
}
}
示例5: ChooseBotsMoveFirstWay
/// <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;
}
}