package robot.mj;

import com.robot.data.Player;
import com.robot.data.Room;

public class EXPlayer extends Player {

	public List<Integer> cardInhand;

	public List<Integer> outcardList;

	public ITArray opCard;

	public List<Object> opCardList; // OpCard

	public int drawCard = 0;
	
	public int outCardCount = 0;

	public boolean skipDraw = false;
	public int winCard = 0;
	
	public boolean tianting = false;
	
	public Object tipMgr; // TipManager
	
	public Object settleLog; // SettleLog
	

	public boolean louhu = false;
	

	public boolean autoOutCard = false;

	public Map<Integer, Object> winMap; // WinCardType
	
	public Object openKong; // OpenKong
	public Set<Integer> llsCardRecord;
	public int piaoNiao = 0;
	
	public int win_count;
	public boolean fengding;


	public List<Object> qsList; // QSLog


	public EXPlayer(int playerid, Room room, String session_id) {
        super(playerid, room, session_id);
    }
	
	private void putSettleLog(String key, int value) {
		// 实现结算日志的put方法
	}

	public void initOpCard(ITArray opcard) {
		this.opCard.clear();
		for (int i = 0; i < opcard.size(); ++i) {
			this.opCard.addInt(opcard.getInt(i));
		}
	}

	public ITObject getReloadInfo() {
		ITObject playerData = super.getReloadInfo();
		ITArray disCard = com.robot.Util.toTArray(this.outcardList);
		playerData.putTArray("outcard_list", disCard);
		playerData.putInt("card_count", cardInhand.size());
		playerData.putInt("score", score.total_score);
		playerData.putBoolean("auto", this.autoOutCard);
		playerData.putInt("draw_card", this.drawCard);
		playerData.putInt("piao_niao", this.piaoNiao);
		playerData.putInt("win_count", this.win_count);
		ITArray opcards = TArray.newInstance();
		// 简化处理：暂时不添加操作牌信息
		playerData.putTArray("opcard", opcards);

		return playerData;
	}

	public void clear() {
		super.clear();
		this.cardInhand.clear();
		this.winer = 0;
		this.louhu = false;
		this.outcardList.clear();
		this.drawCard = 0;
		this.outCardCount = 0;
		this.opCardList.clear();
		this.score.resetRound();
		this.autoOutCard = false;
		this.openKong = null;
		this.winMap = null;
		this.skipDraw = false;
		this.tianting = false;
		this.piaoNiao = 0;
		this.qsList.clear();
		this.fengding = false;
		getRoom().activeKong = null;
		this.llsCardRecord.clear();
	}
	
	public void hp_info(ITObject param) {
		// 实现hp_info方法
		// 添加胡牌相关信息到参数
	}

	public EXRoom getRoom() {
		return (EXRoom) room;
	}
	
}