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

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

import java.util.ArrayList;
import java.util.Random;
import java.util.Set;

/**
 * @author ZhuYongKang
 * @description 2不同号
 * @date 2019/10/21
 */
public class Diff2Number extends SingleK3{

    @Override
    public void random(int... args) {
        clear();
        Set<Integer> set1 = GameUtil.randomList(1, 6, 2);
        ArrayList<Integer> list = new ArrayList<>(set1);
        BetNumber number1 = new BetNumber(String.valueOf(list.get(0)));
        number1.setType(BetNumber.CHECKED);
        BetNumber number2 = new BetNumber(String.valueOf(list.get(1)));
        number2.setType(BetNumber.CHECKED);
        BetNumber number = new BetNumber("*");
        number.setType(BetNumber.CHECKED);
        int index = new Random().nextInt(3);
        if (index == 0) {
            mList1.add(number);
            mList2.add(number1);
            mList3.add(number2);
        } else if (index == 1) {
            mList1.add(number1);
            mList2.add(number);
            mList3.add(number2);
        } else {
            mList1.add(number1);
            mList2.add(number2);
            mList3.add(number);
        }
    }

}
