本文整理匯總了PHP中Game::getGame方法的典型用法代碼示例。如果您正苦於以下問題:PHP Game::getGame方法的具體用法?PHP Game::getGame怎麽用?PHP Game::getGame使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Game
的用法示例。
在下文中一共展示了Game::getGame方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: play
public function play()
{
trace($this->name . ' play');
$game = Game::getGame();
foreach ($game->players as $playerTmp) {
if ($playerTmp->character instanceof static) {
$this->player = $playerTmp;
}
}
}
示例2: draw
public function draw()
{
$game = Game::getGame();
if (array_key_exists(0, $game->districts)) {
$this->hand[] = $game->districts[0];
unset($game->districts[0]);
$game->districts = array_values($game->districts);
trace($this->name . ' draw');
} else {
die('Districts is empty');
}
}
示例3: play
public function play()
{
parent::play();
# Devient le premier joueur
$game = Game::getGame();
foreach ($game->players as $playerTmp) {
$playerTmp->crown = false;
if ($playerTmp->character instanceof self) {
$player = $playerTmp;
$playerTmp->crown = true;
}
}
# Ses quartiers nobles raportent
$this->districtGold($this->player);
}
示例4: spl_autoload_register
<html class="no-js" lang="fr-FR">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Citadelles</title>
<meta name="description" content="Citadelles est un jeu de société créé en 2000 par Bruno Faidutti.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<?php
require 'vendor/autoload.php';
spl_autoload_register(function ($class) {
include __DIR__ . '/classes/' . $class . '.php';
});
function d($v)
{
\utilphp\util::var_dump($v);
}
function trace($v)
{
echo $v . '<br/>';
}
$game = Game::getGame();
$game->init(4);
?>
</div>
</body>
</html>