package extend.mj.player.rulestate;

import com.game.Global;
import com.game.Util;
import com.game.state.StateBase;
import com.taurus.core.entity.ITArray;
import com.taurus.core.entity.TArray;

import extend.mj.EXMainServer;
import extend.mj.EXPlayer;
import extend.mj.OpCard;
import extend.mj.RuleWeight;
import extend.mj.player.state.EXPlayerDrawState;

/**
 * 
 */
public class PRSelfKongState extends StateBase<EXPlayer> {

	@Override
	public void enter(EXPlayer owner) {

		ITArray opCard = owner.opCard;
		int card = opCard.getInt(0);
		Util.removeCard(owner.cardInhand, card, 4);

		owner.opCardList.add(new OpCard(RuleWeight.TYPE_SELF_KONG, card));
		
		ITArray opcard = TArray.newInstance();
		opcard.addInt(card);
		opcard.addInt(card);
		opcard.addInt(card);
		opcard.addInt(card);
		EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_SELF_KONG, owner.seat,opcard,false);
		
		owner.stateMachine.changeState(Global.getState(EXPlayerDrawState.class));
	}

}
