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


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

import java.util.Random;

/**
 * @author ZhuYongKang
 * @description 3D 2D投注实体类
 * @date 2019/10/14
 */
public class TwoD extends OneD {

    @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);
        BetNumber number2 = new BetNumber(String.valueOf(num2));
        number2.setType(BetNumber.CHECKED);
        BetNumber number3 = new BetNumber("-");
        number3.setType(BetNumber.CHECKED);

        //确定哪一位为-
        int n = rand.nextInt(3);
        if (n == 0) {
            mList1.add(number3);
            mList2.add(number2);
            mList3.add(number1);
        } else if (n == 1) {
            mList2.add(number3);
            mList1.add(number2);
            mList3.add(number1);
        } else {
            mList3.add(number3);
            mList1.add(number2);
            mList2.add(number1);
        }
    }
}
