TaskCardVo.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace loyalsoft;
  3. /**
  4. * Description of TaskCardVo
  5. * 任务卡
  6. * @author gwang
  7. */
  8. class TaskCardVo extends Object_ext {
  9. /**
  10. * @var type 这个物品在玩家身上唯一的id
  11. */
  12. public $uid = 0;
  13. /**
  14. * @var type 当前已完成步骤数量
  15. */
  16. public $count = 0;
  17. /**
  18. * @var type 查询用的id
  19. */
  20. public $typeId = 0;
  21. /**
  22. * @var int 任务状态未完成/已完成:0/1
  23. */
  24. public $state = 0;
  25. /**
  26. * @var array[]当前任务步骤数据
  27. */
  28. public $curSteps;
  29. /**
  30. * @var type 当前任务步骤索引
  31. */
  32. public $curStepIndex = 0;
  33. /**
  34. *
  35. * @return type
  36. */
  37. public function mo() {
  38. $mo = GameConfig::item_taskcard_getItem($this->typeId);
  39. my_Assert(null != $mo, ErrCode::err_const_no);
  40. return $mo;
  41. }
  42. public function __construct($args = 0) {
  43. if (isInt($args)) {
  44. $this->typeId = $args;
  45. $arr = array();
  46. $cfg = GameConfig::item_taskcard_getItem($this->typeId);
  47. my_Assert(null != $cfg, ErrCode::err_const_no);
  48. foreach (explode(',', $cfg->tasksteps) as $taskStepTypeId) {
  49. $arr [] = new TaskStepVo($taskStepTypeId);
  50. }
  51. $this->curSteps = $arr;
  52. } else {
  53. parent::__construct($args);
  54. }
  55. }
  56. }