/*
 * Galatea Dialog Manager:
 * (c)2003 Takuya NISHIMOTO (nishi@hil.t.u-tokyo.ac.jp)
 *
 *  $Id: StopOutputCommand.java,v 1.2 2006/11/20 01:13:35 nishi Exp $
 */

package galatea.command;

import galatea.dialog.RuntimeError;

//import galatea.main.*;

public class StopOutputCommand extends Command
{
//	private Debug dbg = new Debug(1);
	
	public StopOutputCommand()
	{
	}
	
	public StopOutputCommand(String cond)
	{
		setCondition(cond);
	}
	
	public String toString()
	{
		String s = "  <stopoutput";
		if ( hasCondition() ) {
			s += " cond=\"" + getConditionAsEncodedString() + "\"";
		}
		s += "/>";
		return s;
	}
	
	
	public void execute() throws RuntimeError
	{
		if ( evaluateCondition() == true ) {
			interpreterContext_.stopOutput();
		}
	}
	
}
