<?php

namespace Test\Task;

use Game\Constant\DBTableDefine;
use Game\Constant\EventTypeDefine;
use Game\Constant\GameConstantDefine;
use Game\Constant\TemplateDefine;
use Game\Data\TaskData;
use Game\Logic\ItemLogic;
use Game\Logic\Task\TaskLogic;
use Game\Protobuf\Task;
use Test\TestBase;
use Game\Model\Task\Manager\WeekTaskManager;

class TestWeekTask extends TestBase
{
    use TaskLogic;
    use ItemLogic;

    public function getPlayerId(): int
    {
        return 288678166824680512;
    }

    public function startTest()
    {
//        //获取周任务信息
//        $weekInfo = $this->getWelfareWeekTask();
//        var_dump($weekInfo);

        //触发任务
//        $param = [
//            GameConstantDefine::EVENT_KEY_MATCH_TIME => 123213231,
//            GameConstantDefine::EVENT_KEY_MATCH_MAP => 1,
//            GameConstantDefine::EVENT_KEY_MATCH_TYPE => 1,
//            GameConstantDefine::EVENT_KEY_CAR_ID => 1031,
//            GameConstantDefine::EVENT_KEY_MATCH_WIN => true,
//            GameConstantDefine::EVENT_KEY_MVP => true
//            ];
//        $this->triggerEvent(EventTypeDefine::EVENT_TYPE_TASK_COMPLETE_MATCH, $param);
//        $taskList = $this->getWelfareWeekTask();
//        var_dump($taskList);

//        //一键提交任务
//        $t = New TaskData(288782139392893618);
//        $t->status = 0;
//        $t->schedule = 0;
//        $t->taskId = 60002;
//        $t->isSync = true;
//        $this->submitTask($t);
//        $task = $this->getTitle(TemplateDefine::TYPE_TASK, 60002);
//        var_dump($task);

        // 道具开宝箱

        $items = $this->getGiftPackItemArr(12, 1);
        var_dump($items);
    }
}