package extend.zp.player.state;

import com.game.ActionEvent;
import com.game.state.StateBase;

import extend.zp.EXMainServer;
import extend.zp.EXPlayer;


public abstract class EXPlayerTipState extends StateBase<EXPlayer> {

	@Override
	public void enter(EXPlayer owner) {
		EXMainServer.gameCtr.tipEvent(owner);
		owner.startActionTimer();
	}

	@SuppressWarnings("unchecked")
	@Override
	public void toNextState(EXPlayer owner) {
		owner.stateMachine.lastState.toNextState(owner);
	}

	@Override
	public void exit(EXPlayer owner) {
		owner.tipMgr.clean();
		owner.stopActionTimer();
	}

	@Override
	public void execute(EXPlayer owner, String cmd, int gid, Object param) {
		if (cmd.equals(ActionEvent.EVENT_ENTRUST)) {
			owner.startActionTimer();
		}
	}
	
	public void reload(EXPlayer owner) {
		super.reload(owner);
		this.enter(owner);

	}
}
