// (c) MIT 2003.  All rights reserved.

package rec.demo;

import java.rmi.*;
import java.util.*;
import speech.*;
import speech.tools.*;
import metaglue.*;
import rec.core.*;
import rec.sys.*;
import rec.fsm.*;
import rec.util.*;
import rec.agent.*;

public class GuideAgent extends TalkAgent
    implements Guide
{
  
  String what_drawing;

  public GuideAgent( ) throws RemoteException
  {
    what_drawing = null;
  }


  /**
   * Incoming speech goes through here.
   */
  public void acceptedTagsResult (Hashtable tags) throws RemoteException
  {
    if ( tags.containsKey( "what_draw" ) )
      {
	tellWhatDraw();
      }
    else
      alert( "I do not understand you, I have a bad grammar in guide agent." );
  }

  public void tellWhatDraw()
  {
    if ( what_drawing != null )
      alert( "You are currently drawing " + what_drawing );
    else
      alert( "I'm sorry, I do not know what you are drawing now." );
  }


  public void setDrawing( String what )
  {
    what_drawing = what;
  }

}



