1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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 (self::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);
- }
- }
- static function isInt($var) {
- $int = intval($var);
- if ((string) $int === (string) $var) {
- return true;
- } else {
- return false;
- }
- }
- }
|