12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace loyalsoft;
- /**
- * Description of TaskCardVo
- * 任务卡
- * @author gwang
- */
- class TaskCardVo extends Object_ext {
- /**
- * @var type 这个物品在玩家身上唯一的id
- */
- public $uid = 0;
- /**
- * @var type 当前已完成步骤数量
- */
- public $count = 0;
- /**
- * @var type 查询用的id
- */
- public $typeId = 0;
- /**
- * @var int 任务状态未完成/已完成:0/1
- */
- public $state = 0;
- /**
- * @var array[]当前任务步骤数据
- */
- public $curSteps;
- /**
- * @var type 当前任务步骤索引
- */
- public $curStepIndex = 0;
- /**
- *
- * @return type
- */
- public function mo() {
- $mo = GameConfig::item_taskcard_getItem($this->typeId);
- my_Assert(null != $mo, ErrCode::err_const_no);
- return $mo;
- }
- public function __construct($args = 0) {
- if (isInt($args)) {
- $this->typeId = $args;
- $arr = array();
- $cfg = GameConfig::item_taskcard_getItem($this->typeId);
- my_Assert(null != $cfg, ErrCode::err_const_no);
- foreach (explode(',', $cfg->tasksteps) as $taskStepTypeId) {
- $arr [] = new TaskStepVo($taskStepTypeId);
- }
- $this->curSteps = $arr;
- } else {
- parent::__construct($args);
- }
- }
- }
|