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

import android.text.TextUtils;

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

import java.util.Set;

/**
 * @author ZhuYongKang
 * @description 猜1D
 * @date 2019/10/14
 */
public class Guess1D extends BoxSum {

    @Override
    public void random(int... args) {
        clear();
        //第一位
        Set<Integer> set1 = GameUtil.randomList(0, 9, 1);
        for (int i : set1) {
            BetNumber number = new BetNumber(String.valueOf(i));
            number.setType(BetNumber.CHECKED);
            mList.add(number);
        }
    }

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