package extend.mj.room.state;


import com.game.Global;
import com.game.data.Player;
import com.game.state.StateBase;

import extend.mj.EXMainServer;
import extend.mj.EXRoom;
import extend.mj.player.state.EXPlayerDrawState;

/**
 * ����ת����λ
 * 
 *
 * 2017��8��30��
 * EXRoomSetpState.java
 */
public class EXRoomSetpState extends StateBase<EXRoom> {

	@Override
	public void enter(EXRoom owner) {
		Player player;
		// TODO Auto-generated method stub
		if (owner.activeSeat == 0) {
			player = owner.playerMapBySeat.get(owner.bankerSeat);

		} else {
			player = owner.playerMapBySeat.get(owner.activeSeat);
			int nextSeat = player.nextSeat;
			player = owner.playerMapBySeat.get(nextSeat);

		}

		EXMainServer.gameCtr.changeActiveSeat(owner,player.seat);
		
		player.stateMachine.changeState(Global.getState(EXPlayerDrawState.class));
		
		this.toNextState(owner);
	}

}
