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

import android.text.TextUtils;

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

import java.util.Random;

/**
 * @author ZhuYongKang
 * @description 3D包胆玩法
 * @date 2019/10/14
 */
public class StraightBase extends BoxSum {

    @Override
    public boolean isFull() {
        return mList.size() >= 1;
    }

    @Override
    public void parseBetData(String betData) {
        if (!TextUtils.isEmpty(betData)) {
            LogTool.logD("betData = " + betData);
            String[] nums = betData.split("\\|");
            for (String num : nums) {
                BetNumber number = new BetNumber(num);
                number.setType(BetNumber.DAN);
                mList.add(number);
            }
        }
    }

    @Override
    public void random(int... args) {
        int num = args[0];
        clear();
        Random rand = new Random();
        while (mList.size() < num) {
            int anInt = rand.nextInt(10);
            BetNumber number = new BetNumber(String.valueOf(anInt));
            number.setType(BetNumber.DAN);
            mList.add(number);
        }
    }

}
