<?php

/**
 * 测试抽奖商城
 */

namespace Test\Shop;

use Framework\MVC\ModelManager;
use Game\GameLive;
use Game\Logic\Shop\ShopBlindBoxLogic;
use Test\TestBase;

class TestShopBlindBox extends TestBase
{
    use ShopBlindBoxLogic;

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

    public function startTest()
    {
        GameLive::getInstance()->InitProtagonistPlayerId($this->getPlayerId());
        ModelManager::getInstance()->setPlayerId($this->getPlayerId());
        //测试抽奖
        $id = 20001;
        $drawNum = 0;
        $drawGroupNum = array();
        $drawIgnoreIds = array();
        $num = 1000;
        $reward = array();
        while ($num > 0) {
            $lotteryReward = $this->lottery($id, $drawNum, $drawGroupNum, $drawIgnoreIds);
            $reward[] = $lotteryReward;
            $drawNum++;
            $num--;
        }
        var_dump($reward);
        var_dump($drawGroupNum);
        var_dump($drawIgnoreIds);

//        [$drawNum, $rewardArr] = $this->drawBlindBox($id, $num);
//        echo $drawNum;
//        var_dump($rewardArr);

//        $boxId = 10002;
//        while ($num > 0) {
//            $lotteryReward = $this->lotteryBox($boxId);
//            var_dump($lotteryReward);
//            $num--;
//        }
    }
}
