package rec.simulate.reasoners;

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

public class SimGearReasoner extends Reasoner 
{
    public Iterator getStrongerTypes()
    {
	Vector v = new Vector();
	v.addElement( "rec.simulate.widgets.WSimGear" );
	return v.iterator();
    }
    
    public Iterator getWeakerTypes()
    {
	Vector v = new Vector();
	v.addElement( "rec.simulate.widgets.wm.WMSimCircle" );
	v.addElement( "rec.simulate.widgets.WSimGear" );
	v.addElement( "rec.simulate.widgets.WSimPinJoint" );
	return v.iterator();
    }
    
    public boolean match( Surface s, Widget stronger, Widget weaker )
    {

	if((weaker instanceof WMSimCircle) &&
	   (stronger instanceof WSimGear)){
	    return true;
	}

	else if((weaker instanceof WSimPinJoint) &&
		(stronger instanceof WSimGear)){
	    return true;
	}

	return false;
    }
}
