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


PHP State::isActive方法代码示例

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


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

示例1: displayDealerHand

function displayDealerHand($state, $upcard, $dealerHand, $dealerScore)
{
    $html = '';
    if (State::isActive($state)) {
        $html .= getImage($upcard);
    } else {
        $html .= getImage($upCard);
        $cards = $dealerHand->getCards();
        foreach ($cards as $card) {
            $html .= getImage($card);
        }
        $html .= '<br><br>';
        $html .= 'The dealer has: ' . $dealerScore;
    }
    return $html;
}
开发者ID:perenchiod,项目名称:php-blackjack,代码行数:16,代码来源:browserview.php

示例2: userStands

 public function userStands()
 {
     if (State::isActive($this->state)) {
         $this->goDealer();
     }
 }
开发者ID:perenchiod,项目名称:php-blackjack,代码行数:6,代码来源:blackjack.php

示例3: elseif

 } elseif (isset($_POST['Stand'])) {
     $game->userStands();
 } elseif (isset($_POST['Double'])) {
     $game->userDoubleDown();
 } elseif (isset($_POST['BuyInsurance'])) {
     $game->buyInsurance(true);
 } elseif (isset($_POST['DeclineInsurance'])) {
     $game->buyInsurance(false);
 }
 $upcard = $game->getDealerHand()->getUpCard();
 $dealerScore = $game->getDealerHand()->getScore();
 $dealerHand = $game->getDealerHand();
 $userScore = $game->getUserHand()->getScore();
 $userHand = $game->getUserHand();
 $state = $game->getState();
 if (State::isActive($state)) {
     $dealEnabled = 0;
     $hitEnabled = 1;
     $standEnabled = 1;
     $wagerEnabled = 0;
     if ($state == State::PLAYING) {
         $doubleEnabled = 1;
     }
 } else {
     $wallet->reconcile($game);
     unset($_SESSION['game']);
     $dealEnabled = 1;
     $hitEnabled = 0;
     $standEnabled = 0;
     $doubleEnabled = 0;
 }
开发者ID:perenchiod,项目名称:php-blackjack,代码行数:31,代码来源:index.php


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