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"); } }
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; } }
/// <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); } }
private void respondOnRaise(PokerEngine.Engine.PlayerBettingAction action) { Speak("Raise!, you might as well fold"); }
private void respondOnFold(PokerEngine.Engine.PlayerBettingAction action) { Speak("Call! I mean fold..."); }
/// <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) { }