<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace loyalsoft;

/**
 * Description of Info_Task
 *
 * @author c'y'zhao
 */
class Info_Task extends Object_ext{
    /**
     * 任务卡道具(存在叠加)
     * @var 
     */
    public $taskcards;
    
    /**
     * 任务卡索引
     * @var type
     */
    public $taskIndex = 0;
    
    /**
     * 每日任务累计值
     * @var type
     */
    //public $dailyTaskAccumulate = 0;
    
    /**
     * 
     * @var type
     */
    #[ArrayType]
    //public $dailyTaskAccumulateDrawed = array();
    
    /**
     * 周常任务累计值
     * @var type
     */
    //public $weekTaskAccumulate = 0;

    /**
     * 
     * @var type
     */
    #[ArrayType]
    //public $weekTaskAccumulateDrawed = array();
    
    /**
     * 成就信息
     * @var type
     */
    public $achieveDic = null;

    //------上面全部旧字段
    
    /**
     * 活动任务信息
     * @var type
     */
    public $activeTaskInfo = null;
    
    public $activeTaskLength = 0; 
    
    /**
     * 7日
     * @var type
     */
    public $day7Point = 0; 
    
    /**
     * 7日活动开始时间
     * @var type
     */
    public $day7_startTs = 0;
    
    /**
     * 日常
     * @var type
     */
    public $dailyTaskPoint = 0; 
    
    /**
     * 周常
     * @var type
     */
    public $weekTaskPoint = 0; 
    
    /**
     * 活跃点领取记录
     * @var type
     */
    #[ArrayType]
    public $activePointReceived = array(); 

    public function initialize() {
      //$this->taskcards = new \stdClass();
      //$this->achieveDic = new \stdClass(); 
        $day7List = GameConfig::activeTask_type_getItemArray(Enum_ActiveTaskType::WeekTask);
        $length = $this->activeTaskLength;
        foreach ($day7List as $key => $task) {
            $length += 1;
            $ins_TaskStep_Active = new Ins_TaskStep_Active($task->id);
            $ins_TaskStep_Active->uid = $length;
            $ins_TaskStep_Active->state = Enum_TaskCardStateType::ing;
            $this->activeTaskInfo->$length = $ins_TaskStep_Active;
        }
        $this->activeTaskLength = $length;
              
    }

    public function __construct($arg = null) {
        if ($arg == null) {
            $this->taskcards = new \stdClass();  
            $this->achieveDic = new \stdClass(); 
            
            $this->activeTaskInfo = new \stdClass();
            
            
            
        } else {
            parent::__construct($arg);
        }
    }
}
