コード例 #1
0
 private void repondOnCall(PokerEngine.Engine.PlayerBettingAction action)
 {
     if (action.CallAmount == 0)
     {
         Speak("I'll take a free card");
     }
     else
     {
         Speak("Call. I want to see how it goes");
     }
 }
コード例 #2
0
        public override void WaitPlayerBettingAction(PokerEngine.Player player, PokerEngine.Engine.PlayerBettingAction action)
        {
            base.WaitPlayerBettingAction(player, action);
            switch (action.Action)
            {
            case PokerEngine.Engine.BetAction.CheckOrCall: repondOnCall(action); break;

            case PokerEngine.Engine.BetAction.Fold: respondOnFold(action); break;

            case PokerEngine.Engine.BetAction.Raise: respondOnRaise(action); break;
            }
        }
コード例 #3
0
        /// <summary>
        /// Called by the client when a bet decision should be made.
        /// </summary>
        /// <param name="player">The automated player.
        /// </param>
        /// <param name="action">The betting action which must be modified to pass the client response</param>
        public override void Bet(PokerEngine.Player player, PokerEngine.Engine.PlayerBettingAction action)
        {
            int decision = rand.Next(100);

            // the decision is with in the call percent range, call:
            if (decision < callPercent)
            {
                action.Call();
            }
            else
            {
                // out of the range, raise!
                action.Raise(action.RaiseAmount);
            }
        }
コード例 #4
0
 private void respondOnRaise(PokerEngine.Engine.PlayerBettingAction action)
 {
     Speak("Raise!, you might as well fold");
 }
コード例 #5
0
 private void respondOnFold(PokerEngine.Engine.PlayerBettingAction action)
 {
     Speak("Call! I mean fold...");
 }
コード例 #6
0
 /// <summary>
 /// Called by the client to get the current player betting action. Derived classes must implement it and respond with a
 /// proper action
 /// </summary>
 /// <param name="player">The player which needs to bet</param>
 /// <param name="action">The action to use to pass the player response</param>
 public void WaitPlayerBettingAction(PokerEngine.Player player, PokerEngine.Engine.PlayerBettingAction action)
 {
 }