package extend.zp.room.state;

import java.util.Map.Entry;

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

import extend.zp.EXRoom;


public class EXRoomStartGameState extends StateBase<EXRoom> {

	@Override
	public void enter(EXRoom owner) {
		// TODO Auto-generated method stub
		//owner.readyCount = 0;
		for (Entry<Integer, Player> entry : owner.playerMapById.entrySet()) {
			Player player = entry.getValue();
			player.clear();
			player.initSeat();
			player.ready = false;
		}
		// if (owner.round == 0) {
		owner.startGame();
		// }
		this.toNextState(owner);
	}

	@Override
	public void toNextState(EXRoom owner) {
		// TODO Auto-generated method stub
		owner.stateMachine.changeState(Global.getState(EXRoomDealState.class));
	}
}
