本文整理汇总了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;
}
示例2: userStands
public function userStands()
{
if (State::isActive($this->state)) {
$this->goDealer();
}
}
示例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;
}