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

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

import java.util.Random;

/**
 * @author ZhuYongKang
 * @description 3D组选3投注实体类
 * @date 2019/9/11
 */
public class ZuXuan3 extends ZuXuan{

    /**
     *  俩号相同
     * @param args int
     */
    @Override
    public void random(int... args) {
        clear();
        //第一位
        Random rand = new Random();
        int num1 = rand.nextInt(10);
        BetNumber number1 = new BetNumber(String.valueOf(num1));
        number1.setType(BetNumber.CHECKED);
        //第二位
        int num2 = rand.nextInt(10);
        while (num2 == num1) {
            num2 = rand.nextInt(10);
        }
        BetNumber number2 = new BetNumber(String.valueOf(num2));
        number2.setType(BetNumber.CHECKED);

        int index = rand.nextInt(3);
        if (index == 0) {
            mList1.add(number2);
            mList2.add(number1);
            mList3.add(number1);
        } else if (index == 1) {
            mList2.add(number2);
            mList1.add(number1);
            mList3.add(number1);
        } else {
            mList3.add(number2);
            mList1.add(number1);
            mList2.add(number1);
        }
    }

}
