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

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.genlot.ninglottery.R;
import com.genlot.ninglottery.event.BetChangeEvent;
import com.genlot.ninglottery.game.bet.IBetBean;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author ZhuYongKang
 * @description  单式一行投注界面
 * @date 2019/8/26
 */
public class OneRowView extends MultiBoxView {

    public OneRowView(Context context, Class type) {
        super(context, type);
    }

    @OnClick(R.id.tv_random1)
    public void randomOneBet(TextView view) {
        IBetBean betBean = mBetList.get(0);
        betBean.random();
        mTextBet.setText(betBean.getAllNumberList());
        EventBus.getDefault().post(new BetChangeEvent(betBean));
    }

    public IBetBean getCurrentBet() {
        return mBetList.get(mCurrentRow);
    }

    public void setRandomGone() {
        mTextRandom.setVisibility(View.GONE);
    }

    @Override
    public int getLayoutID() {
        return R.layout.view_one_row_bet;
    }

    @BindView(R.id.tv_random1)
    TextView mTextRandom;

}
