本文整理汇总了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>