package extend.zp.player.rulestate;

import com.game.Global;
import com.game.player.state.PlayerWaitState;
import com.game.state.StateBase;

import extend.zp.EXPlayer;
import extend.zp.player.state.EXPlayerDiscardState;
import extend.zp.room.state.EXRoomSetpState;

public class PRDrawChiState extends StateBase<EXPlayer> {
	@Override
	public void enter(EXPlayer owner) {
		owner.biCard = 0;
		owner.isTingHu = false;
		this.toNextState(owner);
	}

	@Override
	public void toNextState(EXPlayer owner) {
		if (owner.tiCount > 1) {
			owner.tiCount--;
			owner.stateMachine.changeState(Global.getState(PlayerWaitState.class));
			owner.room.stateMachine.changeState(Global.getState(EXRoomSetpState.class));
		} else {
			owner.stateMachine.changeState(Global.getState(EXPlayerDiscardState.class));
		}
	}

	@Override
	public void exit(EXPlayer owner) {
		// TODO Auto-generated method stub

	}

	@Override
	public void execute(EXPlayer owner, String cmd, int gid, Object param) {
		// TODO Auto-generated method stub

	}
}
