package extend.pk.room.state;

import com.game.Global;
import com.game.data.Player;
import com.game.state.StateBase;
import extend.pk.EXPlayer;
import extend.pk.EXRoom;

import java.util.Map.Entry;

/**
 * 房间开始状态
 * 
 * 
 */
public class EXRoomStartGameState extends StateBase<EXRoom> {

	@Override
	public void enter(EXRoom owner) {
		
		for (Entry<Integer, Player> entry : owner.playerMapBySeat.entrySet()) { 
			EXPlayer player = (EXPlayer)entry.getValue();
			player.clearEx();
		}
		owner.clearEx();
		owner.startGame();
		
		this.toNextState(owner);
	}

	@Override
	public void toNextState(EXRoom owner) {
		

		owner.stateMachine.changeState(Global.getState(EXRoomDealState.class));

	}
}
