@Override
	public Area findArea(XMLLibrary.XMLpiece piece, Map<String,Object> defined, int directions) throws CMException
	{
		final String tagName="AREA";
		final List<XMLLibrary.XMLpiece> choices = getAllChoices(null,null,null,tagName, piece, defined,true);
		if((choices==null)||(choices.size()==0))
		{
			return null;
		}
		while(choices.size()>0)
		{
			final XMLLibrary.XMLpiece valPiece = choices.get(CMLib.dice().roll(1,choices.size(),-1));
			choices.remove(valPiece);
			if(valPiece.parms.containsKey("VALIDATE") && !testCondition(CMLib.xml().restoreAngleBrackets(CMLib.xml().getParmValue(valPiece.parms,"VALIDATE")),valPiece, defined))
				continue;
			final Map<String,Object> rDefined=new Hashtable<String,Object>();
			rDefined.putAll(defined);
			defineReward(null,null,null,valPiece,null,rDefined);
			final Area A=buildArea(valPiece,rDefined,directions);
			for (final String key : rDefined.keySet())
			{
				if(key.startsWith("_"))
					defined.put(key,rDefined.get(key));
			}
			return A;
		}
		return null;
	}