package extend.mj;

import com.taurus.core.entity.ITArray;
import com.taurus.core.entity.ITObject;
import com.taurus.core.entity.TArray;
import com.taurus.core.entity.TObject;
import extend.mj.uitl.CardUtil;

import java.util.ArrayList;
import java.util.List;

public class OpenKong {

	public int diceNum1;
	public int diceNum2;

	/**
	 * 
	 */
	public int fromSeat;


	public int kongSeat;
	public List<Integer> drawList;
	
	public boolean haidi;
	
	public int tipActionSeat = -1;

	public OpenKong() {
		drawList = new ArrayList<Integer>();

		diceNum1 = CardUtil.randomDiceNum();
		diceNum2 = CardUtil.randomDiceNum();
	}

	public ITObject getTObject() {
		ITObject data = TObject.newInstance();
		data.putInt("diceNum1", diceNum1);
		data.putInt("diceNum2", diceNum2);

		data.putInt("from_seat", fromSeat);
		data.putInt("kong_seat", kongSeat);

		ITArray cardList = TArray.newInstance();
		for (int card : drawList) {
			cardList.addInt(card);
		}
		data.putTArray("cardList", cardList);
		return data;
	}
}
