本文整理汇总了PHP中Booster::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP Booster::generate方法的具体用法?PHP Booster::generate怎么用?PHP Booster::generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Booster
的用法示例。
在下文中一共展示了Booster::generate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: begin
public function begin()
{
// Launch first step for tournament (draft, build ...)
// DB
shuffle($this->players);
// Give random numbers to players
foreach ($this->players as $i => $player) {
$player->insert($i);
}
// And store them now we're sure to start
// TS3
if ($this->observer->ts3) {
ts3_co();
$cid = ts3_chan('Tournament ' . $this->id, $this->name);
// Create chan
ts3_invite($this->players, $cid);
// Move each tournament's player to chan
ts3_disco();
}
// Unicity
$upool = array();
// All cards in current tournament's players pools
//that comes from a "uniq" extension
switch ($this->format) {
case 'draft':
$number = 0;
foreach ($this->data->boosters as $ext) {
$number++;
// Number of current booster in draft for player
//$booster = null ;
foreach ($this->players as $player) {
//if ( ( $booster == null ) || ! $this->data->clone_sealed ) {
$booster = new Booster($this, $player->order, $number);
$booster->generate($ext, $upool);
/*} else {
$boost = new Booster($this, $player->order, $number) ;
$boost->get_content($booster->content) ;
$boost->insert() ;
}*/
$this->boosters[] = $booster;
}
}
$this->set_status(3);
$this->timer_goon(Tournament::draft_time());
$this->log('', 'draft', '');
break;
case 'sealed':
foreach ($this->data->boosters as $ext) {
$ext_obj = Extension::get($ext);
if ($ext_obj == null) {
$this->say("Extension {$ext} not found in sealed generation");
continue;
}
$booster = null;
foreach ($this->players as $player) {
if ($booster == null || !$this->data->clone_sealed) {
$booster = $ext_obj->booster($upool);
}
// Only need object in memory for sealed
foreach ($booster as $card) {
$player->pick($card);
}
}
}
foreach ($this->players as $player) {
$player->summarize(true);
}
$this->build();
break;
default:
$this->start();
}
}