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

// $Id: RodReasoner.java,v 1.4 2003/03/06 00:40:41 moltmans Exp $
// Time-stamp: <2000-03-11 18:59:37 moltmans>
package rec.simulate.reasoners;


import java.io.*;
import java.util.*;
import rec.util.*;
import rec.sys.*;
import rec.simulate.widgets.*;


public class RodReasoner extends Reasoner 
{
  public RodReasoner()
  {
    super();
  }


  //////////////////////////////////////////////////////////////////////////////
  public Iterator getStrongerTypes()
  {
    Vector v = new Vector();

    v.addElement( "rec.simulate.widgets.WSimObject" );

    return v.iterator();
  }

  public Iterator getWeakerTypes()
  {
    Vector v = new Vector();

    v.addElement( "rec.simulate.widgets.WSimRod" );
    v.addElement( "rec.simulate.widgets.WSimRope" );

    return v.iterator();
  }

  public boolean match( Surface s, Widget stronger, Widget weaker )
  {
      if (stronger instanceof WSimRope){
	  return false;
      }
      else if ( stronger instanceof WSimRod){
	  
	  if (weaker instanceof WSimRope){
	      return true;
	  }
	  else{
	      return false;
	  }
      }
      else {
	  return true;
      }
      
      
  }
    
    
}
