<?php

/**
 * 消耗货币
 */

namespace Game\Model\Task\Logic;

use Game\Constant\ConstTemplate\TemplateTask;
use Game\Constant\GameConstantDefine;
use Game\Data\TaskData;

class TaskLogicCostMoney extends TaskLogicBase
{

    public function getDefaultValue(TaskData $taskData, array $param)
    {
    }

    public function updateTask(TaskData $taskData, array $param)
    {
        //检查货币类型
        if ($taskData->taskConfig[TemplateTask::Condition] == $param[GameConstantDefine::EVENT_KEY_MONEY]) {
            $this->updateTaskSchedule($taskData, $param[GameConstantDefine::EVENT_KEY_NUM]);
            if ($this->checkIsDone($taskData)) {
                $taskData->schedule = $taskData->taskConfig[TemplateTask::Target];
                $taskData->status = TaskData::STATUS_DONE;
            }
        }
    }
}
