import madkit.kernel.GroupIdentifier;
import madkit.kernel.AgentAddress;

import java.util.Vector;




public class MonGroupFilter implements GroupIdentifier{
	Vector agentAddressList=new Vector(10,10);
	String password;
	String role;
	
	public MonGroupFilter(String p, String r){
	    password=p;
	    role=r;
	}
	
	public boolean allowAgentToTakeRole(AgentAddress requester, String roleName, Object memberCard) {
	    if (memberCard != null && memberCard instanceof String && roleName==role)
		return (memberCard).equals(password);
	    return false;
	}
	public boolean allowOverlooking(AgentAddress requester, Object accessCard) {
	    return allowAgentToTakeRole(requester, null, accessCard);
	}
    }
