本文整理汇总了PHP中SR_Player::getPartyID方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::getPartyID方法的具体用法?PHP SR_Player::getPartyID怎么用?PHP SR_Player::getPartyID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::getPartyID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPlayerInLocation
/**
* @param SR_Player $player
* @param string $name
* @return SR_Player
*/
public static function getPlayerInLocation(SR_Player $player, $name)
{
if (false === ($back = Shadowrun4::getPlayerByName($name))) {
return false;
}
# Same party
if ($back->getPartyID() === $player->getPartyID()) {
return $back;
}
if (self::sharesLocation($player, $back)) {
return $back;
}
return false;
}
示例2: setLeader
public function setLeader(SR_Player $player)
{
if ($player->getPartyID() !== $this->getID()) {
return false;
}
$pid = $player->getID();
$td = $this->distance[$pid];
unset($this->members[$pid]);
unset($this->distance[$pid]);
$t1 = array($pid => $player);
$t2 = array($pid => $td);
foreach ($this->members as $pid2 => $member) {
$t1[$pid2] = $member;
$t2[$pid2] = $this->distance[$pid2];
}
$this->members = $t1;
$this->distance = $t2;
if (false === $this->updateMembers()) {
return false;
}
$this->recomputeEnums();
return true;
}