package extend.mj.player.state;

import com.game.state.StateBase;

import extend.mj.EXActionEvent;
import extend.mj.EXMainServer;
import extend.mj.EXPlayer;
import extend.mj.PlayerRuleManager;

/**
 * 
 */
public class EXPlayerWaitState extends StateBase<EXPlayer> {

//	@SuppressWarnings("unchecked")
//	@Override
//	public void toNextState(EXPlayer owner) {
//		if(owner.getRoom().activeKong!=null){
//			if(owner.getRoom().activeKong.kongSeat == owner.seat){
//				owner.stateMachine.lastState.toNextState(owner);
//			}
//		}
//	}
	
	@Override
	public void execute(EXPlayer owner, String cmd, int gid, Object param) {
		boolean old_louhu =  owner.louhu;
		switch (cmd) {
		case EXActionEvent.EVENT_OTHER_DISCARD:
			EXMainServer.playerRuleMgr.condition( PlayerRuleManager.OTHER_DISCARD_RULE , owner);
			break;
		case EXActionEvent.EVENT_KONG_WIN:
			owner.louhu = false;
			EXMainServer.playerRuleMgr.condition( PlayerRuleManager.KONG_HU_RULE , owner);
			break;
		case EXActionEvent.EVENT_OPENKONG:
			owner.louhu = false;
			EXMainServer.playerRuleMgr.condition( PlayerRuleManager.OPENKONG_RULE , owner);
			break;
		default:
			break;
		}
		owner.louhu =old_louhu;
		
	}

}
