/// <summary> /// This method returns the hand for the SeatNumber given. /// If there is not a player seated at this seat or if he is sitting /// out this hand may return null so always test it exists before /// reffering to it. /// </summary> /// <param name="seatNumber"></param> /// <returns></returns> public Hand GetHand(SeatNumberEnum seatNumber) { // initial value Hand hand = null; // If the Hands object exists if (this.HasHands) { // iterate the hands collection foreach (Hand tempHand in this.Hands) { // If the value for the property tempHand.HasPlayer is true if (tempHand.HasPlayer) { // if this is the SeatNumber given if (tempHand.Player.SeatNumber == seatNumber) { // set the return value hand = tempHand; // break out of the loop break; } } } } // return value return(hand); }
/// <summary> /// This method shows an Action Message /// </summary> internal void ShowActionMessage(string message, SeatNumberEnum seatNumber) { // Find the playerControl BlackJackPlayerControl playerControl = FindBlackJackPlayerControl(seatNumber); // If the playerControl object exists if (NullHelper.Exists(playerControl)) { // Show the action message playerControl.ShowActionMessage(message); } }
/// <summary> /// This method returns the Black Jack Player Control /// </summary> private BlackJackPlayerControl FindBlackJackPlayerControl(SeatNumberEnum seatNumber) { // initial value BlackJackPlayerControl blackJackPlayerControl = null; // Determine the action by the seatNumber switch (seatNumber) { case SeatNumberEnum.Seat1: // set the control blackJackPlayerControl = this.BlackJackPlayerControl1; // required break; case SeatNumberEnum.Seat2: // set the control blackJackPlayerControl = this.BlackJackPlayerControl2; // required break; case SeatNumberEnum.Seat3: // set the control blackJackPlayerControl = this.BlackJackPlayerControl3; // required break; case SeatNumberEnum.Seat4: // set the control blackJackPlayerControl = this.BlackJackPlayerControl4; // required break; case SeatNumberEnum.Seat5: // set the control blackJackPlayerControl = this.BlackJackPlayerControl5; // required break; } // return value return(blackJackPlayerControl); }
/// <summary> /// This method returns the Player Editor Control /// </summary> internal PlayerEditorControl GetPlayerEditorControl(SeatNumberEnum seatNumber) { // initial value PlayerEditorControl playerEditor = null; // get the value of seatNumber int seatNumberValue = (int)seatNumber; // call the overload playerEditor = GetPlayerEditorControl(seatNumberValue); // return value return(playerEditor); }
/// <summary> /// This method returns the Player Control /// </summary> private static BlackJackPlayerControl FindPlayerControl(List <BlackJackPlayerControl> playerControls, SeatNumberEnum seatNumber) { // initial value BlackJackPlayerControl playerControl = null; // If the playerControls collection exists and has one or more items if (ListHelper.HasOneOrMoreItems(playerControls)) { // Iterate the collection of BlackJackPlayerControl1 objects foreach (BlackJackPlayerControl tempPlayerControl in playerControls) { // if this is the control being sought if (tempPlayerControl.SeatNumber == seatNumber) { // Set the SeatNumber playerControl = tempPlayerControl; // break out of the loop break; } } } // return value return(playerControl); }
/// <summary> /// method pays Off player's Bet /// </summary> internal void PayOffBet(SeatNumberEnum seatNumber, double lastBetAmount, bool isBlackJack = false) { }