=1代表完成) */ public $progress = 0; /** * 用于将进度更新的数据待会给客户端,比如当前PVP积分之类的,在客户端是无法即时拿到数据的 * @var object */ public $tag1; public $tag2; /** * @var int 计数器 */ public $counter = 0; /** * @return \sm_task_step mo */ public function mo() { $mo = GameConfig::task_step_getItem($this->typeId); my_Assert(null != $mo, ErrCode::err_const_no); return $mo; } public function __construct($args) { if (isInt($args)) { $this->typeId = $args; } else { parent::__construct($args); } } /** * @param TaskParams $taskParam * @return bool */ public function check($taskParam) { if ($this->progress >= 1) { return true; } if ($taskParam->taskType == $this->mo()->tasktype) { if (null == $this->mo()->canshu1) { $this->progress = 1; return true; } if ($this->mo()->canshu1 == $taskParam->canshu1) { $this->tag1 = $taskParam->canshu1; if (null == $this->mo()->canshu2 || 0 == $this->mo()->canshu2) { $this->progress = 1; $this->tag2 = $taskParam->canshu2; return true; } else { if (is_numeric($this->mo()->canshu2)) { $this->tag2 = max($this->tag2, $taskParam->canshu2); if ($this->mo()->canshu2 <= $taskParam->canshu2) { $this->progress = 1; return true; } } else { $this->tag2 = $taskParam->canshu2; if ($this->mo()->canshu2 == $taskParam->canshu2) { $this->progress = 1; return true; } } } } } return false; } }