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 PlayerSpectatorState extends StateBase<Player> {
	/**
	 * 进入状态时处理
	 * 
	 * @param owner
	 */
	public void enter(Player owner) {
		owner.spectator = true;
	}

	/**
	 * 退出状态时处理
	 * 
	 * @param owner
	 */
	public void exit(Player owner) {
		owner.spectator = false;
	}

	@Override
	public void execute(Player owner, String cmd, int gid, Object param) {
		switch (cmd) {
		case ActionEvent.EVENT_EXIT_ROOM:
			Global.gameCtr.exitRoom(owner, gid,false);
			break;
//		case ActionEvent.EVENT_READY:
//			if(owner.room.playerMapBySeat.containsKey(owner.seat)) {
//				Global.gameCtr.ready(owner);
//			}
//			break;
		}
	}
}
