123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <?php
- /**
- * 用户个人信息
- * Date: 15-12-15
- * Time: 下午2:31
- */
- class UserInfo extends AbstractDataContent {
- public $guildId;//必填 用户加入的公会的ID 用户登录游戏成功后
- public $guildName;//必填 用户加入的公会的名称
- public $guildLevel;//必填 用户加入的公会的等级
- public $guildLeader;//必填 用户加入的公会的会长的账号ID
- public $zoneId;//必填 区服ID
- public $zoneName;//必填 区服名称
- public $power;//必填 个人战力值
- public $os;//必填 游戏平台 android或者ios,小写字母。默认为android
- public $roleId;//非必填 角色ID
- public $roleName;//非必填 角色昵称
- /**
- * @return mixed
- */
- public function getGuildId()
- {
- return $this->guildId;
- }
- /**
- * @param mixed $guildId
- */
- public function setGuildId($guildId)
- {
- $this->guildId = $guildId;
- }
- /**
- * @return mixed
- */
- public function getGuildName()
- {
- return $this->guildName;
- }
- /**
- * @param mixed $guildName
- */
- public function setGuildName($guildName)
- {
- $this->guildName = $guildName;
- }
- /**
- * @return mixed
- */
- public function getGuildLevel()
- {
- return $this->guildLevel;
- }
- /**
- * @param mixed $guildLevel
- */
- public function setGuildLevel($guildLevel)
- {
- $this->guildLevel = $guildLevel;
- }
- /**
- * @return mixed
- */
- public function getGuildLeader()
- {
- return $this->guildLeader;
- }
- /**
- * @param mixed $guildLeader
- */
- public function setGuildLeader($guildLeader)
- {
- $this->guildLeader = $guildLeader;
- }
- /**
- * @return mixed
- */
- public function getPower()
- {
- return $this->power;
- }
- /**
- * @param mixed $power
- */
- public function setPower($power)
- {
- $this->power = $power;
- }
- /**
- * @return mixed
- */
- public function getZoneId()
- {
- return $this->zoneId;
- }
- /**
- * @param mixed $zoneId
- */
- public function setZoneId($zoneId)
- {
- $this->zoneId = $zoneId;
- }
- /**
- * @return mixed
- */
- public function getZoneName()
- {
- return $this->zoneName;
- }
- /**
- * @param mixed $zoneName
- */
- public function setZoneName($zoneName)
- {
- $this->zoneName = $zoneName;
- }
- /**
- * @return mixed
- */
- public function getOs()
- {
- return $this->os;
- }
- /**
- * @param mixed $os
- */
- public function setOs($os)
- {
- $this->os = $os;
- }
- /**
- * @return mixed
- */
- public function getRoleId()
- {
- return $this->roleId;
- }
- /**
- * @param mixed $roleId
- */
- public function setRoleId($roleId)
- {
- $this->roleId = $roleId;
- }
- /**
- * @return mixed
- */
- public function getRoleName()
- {
- return $this->roleName;
- }
- /**
- * @param mixed $roleName
- */
- public function setRoleName($roleName)
- {
- $this->roleName = $roleName;
- }
- /**
- * 必填参数校验
- * @return
- * true:校验通过 false:有参数为空
- */
- public function validate()
- {
- if(!isset($this->guildId)){
- return false;
- }
- if(!isset($this->guildName)){
- return false;
- }
- if(!isset($this->guildLevel)){
- return false;
- }
- if(!isset($this->guildLeader)){
- return false;
- }
- if(!isset($this->zoneId)){
- return false;
- }
- if(!isset($this->zoneName)){
- return false;
- }
- if(!isset($this->power)){
- return false;
- }
- if(!$this->checkOs($this->os)){
- return false;
- }
- return true;
- }
- private function checkOs($roleOs){
- $osName = array("android", "ios");
- foreach ($osName as $tempOs) {
- if($roleOs == $tempOs){
- return true;
- }
- }
- return false;
- }
- }
|