本文整理汇总了PHP中Weapon::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Weapon::create方法的具体用法?PHP Weapon::create怎么用?PHP Weapon::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weapon
的用法示例。
在下文中一共展示了Weapon::create方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_object
public function create_object($data)
{
return Weapon::create($data);
}
示例2: Weapon
$weapon->isAttack = 1;
$weapon->weaponCount = $amount;
$weapon->weaponStrength = $conf['weapon' . $wId . 'strength'];
if ($amount and $weapon->create()) {
$t->saWeapons[] = $weapon;
}
}
foreach ($tobuy[0] as $wId => $amount) {
$weapon = new Weapon();
$weapon->userId = $user->id;
$weapon->weaponId = $wId;
$weapon->isAttack = 0;
$weapon->weaponCount = $amount;
$weapon->weaponStrength = $conf['weapon' . $wId . 'strength'];
if ($amount and $weapon->create()) {
$t->daWeapons[] = $weapon;
}
}
$user->cacheStats();
}
else {
$t->err = 'Not enough Gold';
}
}
$t->user = $user;
if (!$t->saWeapons and !$t->daWeapons) {