package com.game.player.state;

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

/**
 * 玩家准备状态
 * 
 *
 */
public class PlayerReadyState extends StateBase<Player> {

	@Override
	public void enter(Player owner) {
		owner.ready = true;
		owner.room.stateMachine.execute(ActionEvent.EVENT_READY, 0, null);
	}

	@Override
	public void execute(Player owner, String cmd, int gid, Object param) {
		if(owner.room.round>0)return;
		if(cmd.equals(ActionEvent.EVENT_EXIT_ROOM)) {
			Global.gameCtr.exitRoom(owner, gid,false);
		}
	}

}
