/// <summary> /// This method is used to get the values of all Flop Cards when /// someone click on Deal Buttons except Hole Button. Then save /// that value of Flop Card to Session. /// Also get CSS value from session as described below. */ /// </summary> private void f_update_hedgeem_control_board_cards_with_info_from_server() { try { log.Debug("f_update_hedgeem_control_board_cards_with_info_from_server called"); // Create the FLOP card instances cc_flop_card1 = new hedgeem_control_card(); cc_flop_card2 = new hedgeem_control_card(); cc_flop_card3 = new hedgeem_control_card(); // Get reference to the Application scoped Hedge'Em control that models the 'Turn' card // xxx NOTE the only reason the TURN card is coded diffently from other board cards was to prove that // it could be coded as an application scoped control. I (Simon) do not know which method is best. // Logically there should only ever be one instance of a TURN card at any given table so I was thinking // it would be best to instantiate only once. hedgeem_control_card my_turn_card = new hedgeem_control_card(); hedgeem_control_card my_river_card = new hedgeem_control_card(); hedgeem_control_jackpot my_control_jackpot = new hedgeem_control_jackpot(); my_control_jackpot.p_jackpot_balance = my_jackpot_fund; // Note expect card as short string to be something like ac (ace of clubs), 6d (six of diamonds etc) // If ZZ us returned this implies the card is to be shown face down. p_flop_card1_as_short_string = _global_game_state_object.p_flop_card1_string; p_flop_card2_as_short_string = _global_game_state_object.p_flop_card2_string; p_flop_card3_as_short_string = _global_game_state_object.p_flop_card3_string; p_turn_as_short_string = _global_game_state_object.p_turn_card_string; p_river_as_short_string = _global_game_state_object.p_river_card_string; // Set the FLOP, TURN and RIVER card values using values specified by server // E.g. if the Server thinks the FLOP card in 'Six of clubs' (6c) set GUI control to 6c cc_flop_card1.p_card_as_short_string = p_flop_card1_as_short_string; cc_flop_card2.p_card_as_short_string = p_flop_card2_as_short_string; cc_flop_card3.p_card_as_short_string = p_flop_card3_as_short_string; my_turn_card.p_card_as_short_string = p_turn_as_short_string; my_river_card.p_card_as_short_string = p_river_as_short_string; // Set the style attribute for the Board card (e.g. whether they are position in left,right or middle position) cc_flop_card1.p_enum_card_position = enum_card_position.MIDDLE; cc_flop_card2.p_enum_card_position = enum_card_position.MIDDLE; cc_flop_card3.p_enum_card_position = enum_card_position.MIDDLE; my_turn_card.p_enum_card_position = enum_card_position.MIDDLE; my_river_card.p_enum_card_position = enum_card_position.MIDDLE; cc_flop_card1.p_cssclass = "card_left_flop"; cc_flop_card2.p_cssclass = "card_middle_flop"; cc_flop_card3.p_cssclass = "card_right_flop"; my_turn_card.p_cssclass = "card_middle_turn"; my_river_card.p_cssclass = "card_middle_river"; Place_Holder_Flop_Cards.Controls.Add(cc_flop_card1); Place_Holder_Flop_Cards.Controls.Add(cc_flop_card2); Place_Holder_Flop_Cards.Controls.Add(cc_flop_card3); Place_Holder_Turn_Cards.Controls.Add(my_turn_card); Place_Holder_River_Cards.Controls.Add(my_river_card); Place_Holder_Table_Jackpot.Controls.Add(my_control_jackpot); lbl_game_id.Text = String.Format("Table/Game: {0}/{1} ", _global_game_state_object.p_table_id, game_id); // Control to show placed bets. Only show during betting stages HOLE, FLOP and TURN and at RIVER/PAYOUT stage. if (_game_state >= enum_game_state.STATUS_HOLE && _game_state <= enum_game_state.STATUS_RIVER) { hedgeem_control_placed_bets my_control_placed_bets = new hedgeem_control_placed_bets(); int count = _global_game_state_object._recorded_bets.Count; int bets = 0; foreach (HedgeEmBet hedgeem_bets in _global_game_state_object._recorded_bets) { bets = (int)hedgeem_bets.p_bet_amount; } p_total_bets = bets * count; my_control_placed_bets.p_placed_bets = p_total_bets; Place_Holder_Placed_Bets.Controls.Add(my_control_placed_bets); } } catch (Exception ex) { string my_error_popup = "alert('" + ex.Message.ToString() + "');"; ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", my_error_popup, true); HedgeEmLogEvent my_log = new HedgeEmLogEvent(); my_log.p_message = "Exception caught in f_update_hedgeem_control_board_cards_with_info_from_server function " + ex.Message; my_log.p_method_name = "f_update_hedgeem_control_board_cards_with_info_from_server"; my_log.p_player_id = f_get_player_id(); my_log.p_game_id = game_id; my_log.p_table_id = _table_id; log.Error(my_log.ToString()); } }
private void Controls_for_Betting_Panels_and_Board_Cards() { cc_flop_card1 = new hedgeem_control_card(); cc_flop_card2 = new hedgeem_control_card(); cc_flop_card3 = new hedgeem_control_card(); cc_turn_card = new hedgeem_control_card(); cc_river_card = new hedgeem_control_card(); cc_flop_card1.p_enum_card_position = enum_card_position.LEFT; cc_flop_card2.p_enum_card_position = enum_card_position.MIDDLE; cc_flop_card3.p_enum_card_position = enum_card_position.RIGHT; cc_turn_card.p_enum_card_position = enum_card_position.MIDDLE; cc_river_card.p_enum_card_position = enum_card_position.MIDDLE; ss_seat = new hedgeem_control_seats(); }