本文整理汇总了PHP中Player::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::__construct方法的具体用法?PHP Player::__construct怎么用?PHP Player::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param array $properties
*/
public function __construct(array $properties)
{
// Fix slot
if (isset($properties['player_slot'])) {
$binary = sprintf("%08d", decbin($properties['player_slot']));
$properties['team'] = intval(substr($binary, 0, 1));
$properties['slot'] = intval(bindec(substr($binary, 1)));
}
parent::__construct($properties);
}
示例2: __construct
/**
* __constructor method
* @param string $name
* @param array $params
* */
public function __construct($name, $params = null)
{
parent::__construct($name);
if (!is_null($params)) {
foreach ($params as $index => $param) {
if (method_exists($this, 'set' . ucfirst($index))) {
$this->{'set' . ucfirst($index)}($param);
} elseif (property_exists($this, $index)) {
$this->{$index} = $param;
}
}
}
}
示例3: __construct
public function __construct()
{
parent::__construct("Banque");
}
示例4: __construct
public function __construct($username, $password)
{
parent::__construct($username, $password);
}
示例5: __construct
/** public function __construct
* Class constructor
* Sets all outside data
*
* @param int optional player id
* @action instantiates object
* @return void
*/
public function __construct($id = null)
{
$this->_mysql = Mysql::get_instance();
// check and make sure we have logged into this game before
if (0 != (int) $id) {
$query = "\n\t\t\t\tSELECT COUNT(*)\n\t\t\t\tFROM " . self::EXTEND_TABLE . "\n\t\t\t\tWHERE player_id = '{$id}'\n\t\t\t";
$count = (int) $this->_mysql->fetch_value($query);
if (0 == $count) {
throw new MyException(__METHOD__ . ': ' . GAME_NAME . ' Player (#' . $id . ') not found in database');
}
}
parent::__construct($id);
}
示例6: __construct
public function __construct($t, $f = "", $l = "")
{
parent::__construct($f, $l);
$this->Team = $t;
}
示例7: __construct
public function __construct($noOfDecks = 2)
{
parent::__construct('Dealer');
$this->deck = new Deck($noOfDecks);
$this->deck->shuffle();
}
示例8: __construct
public function __construct($playersName)
{
$this->scoreVisible = true;
$this->cardVisible = true;
parent::__construct($playersName);
}
示例9: __construct
public function __construct($email)
{
parent::__construct($email);
}
示例10: __construct
public function __construct($fullName = null)
{
parent::__construct($fullName);
}
示例11: __construct
public function __construct()
{
parent::__construct(0);
}