package com.genlot.ninglottery.game.d3.bean;

import com.genlot.ninglottery.game.bet.BetNumber;
import com.genlot.ninglottery.toolkit.GameUtil;
import com.genlot.ninglottery.toolkit.StringTool;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author ZhuYongKang
 * @description 组选6胆拖
 * @date 2019/10/16
 */
public class BaseBox6 extends BaseD3{

    @Override
    public void random(int... args) {
        clear();
        int dan = args[0];
        int tuo = args[1];
        Set<Integer> redSet = GameUtil.randomList(0, 9, dan + tuo);
        List<Integer> tuoList = new ArrayList<>(redSet);
        //胆
        Set<Integer> danSet = GameUtil.randomSplitList(tuoList, dan);
        for (int i : danSet) {
            BetNumber number = new BetNumber(String.valueOf(i));
            number.setType(BetNumber.DAN);
            mDanList.add(number);
        }
        //拖
        for (int i : tuoList) {
            BetNumber number = new BetNumber(StringTool.format2(i));
            number.setType(BetNumber.CHECKED);
            mTuoList.add(number);
        }
    }

}
