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


PHP Render::player_text方法代码示例

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


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

示例1: render_game

 public function render_game($game, $start_hand = false, $controls = true)
 {
     $i = 0;
     foreach ($game->players as $player) {
         $alt_seat = $i == 0 ? 1 : 0;
         $render = array('game_id' => $game->id, 'game-' . $game->id . '-player_cards' => Render::player_cards($game, '', $player), 'game-' . $game->id . '-player_text' => Render::player_text($game, '', $player), 'game-' . $game->id . '-opponent_cards' => Render::player_cards($game, $alt_seat), 'game-' . $game->id . '-opponent_text' => Render::player_text($game, $alt_seat), 'game-' . $game->id . '-community_cards' => Render::community_cards(), 'game-' . $game->id . '-pot' => '<b>Pot: $' . $game->get_pot_value() . '</b>');
         if ($game->current_turn == $i && $controls) {
             $render['game-' . $game->id . '-game_controls'] = Render::game_actions($game, $player);
         }
         $this->send_to_one($player->client_id, 'game_render', $render);
         if ($start_hand) {
             // send their cards to the game log
             $this->send_to_one($player->client_id, 'game_log', array('game_id' => $game->id, 'msgs' => array('<b>You were dealt:</b> &nbsp;' . Render::player_cards($game, $i, $player))));
         }
         $i++;
     }
 }
开发者ID:shinichi81,项目名称:laravel-pkr,代码行数:17,代码来源:server.php


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