当前位置: 首页>>代码示例>>C#>>正文


C# ICharacter.RaiseBet方法代码示例

本文整理汇总了C#中ICharacter.RaiseBet方法的典型用法代码示例。如果您正苦于以下问题:C# ICharacter.RaiseBet方法的具体用法?C# ICharacter.RaiseBet怎么用?C# ICharacter.RaiseBet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICharacter的用法示例。


在下文中一共展示了ICharacter.RaiseBet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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;
            }
        }
开发者ID:MiBuena,项目名称:HighQualityProject,代码行数:63,代码来源:DecisionMaker.cs

示例2: 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);
//.........这里部分代码省略.........
开发者ID:MiBuena,项目名称:HighQualityProject,代码行数:101,代码来源:DecisionMaker.cs

示例3: 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);
         }
     }
 }
开发者ID:MiBuena,项目名称:HighQualityProject,代码行数:25,代码来源:DecisionMaker.cs

示例4: 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;
            }
        }
开发者ID:MiBuena,项目名称:HighQualityProject,代码行数:73,代码来源:DecisionMaker.cs


注:本文中的ICharacter.RaiseBet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。