It's really straight forward. Just implement that Interface

. Nevertheless, i'll post an example:
My implementation of the interface. I dont work with TMX map, but rather used my own map system
Using java Syntax Highlighting
public class PathfinableMapProxy implements ITiledMap<Map>
{
public static final int PASSABLE_PATHONLY = 1;
public static final int PASSABLE_WATERONLY = 2;
public static final int PASSABLE_PATHANDFIELD = 3;
protected Map map;
protected int passableMode;
public PathfinableMapProxy(Map map, int passableMode)
{
this.map = map;
this.passableMode = passableMode;
}
@Override
public int getTileColumns()
{
return map.getMapSizeX();
}
@Override
public int getTileRows()
{
return map.getMapSizeY();
}
@Override
public void onTileVisitedByPathFinder(int pTileColumn, int pTileRow)
{
//nothing here
}
@Override
public boolean isTileBlocked(Map pEntity, int pTileColumn, int pTileRow)
{
if(map.isTileWithinbounds(pTileColumn, pTileRow))
{
switch(this.passableMode)
{
case PASSABLE_PATHONLY:
//TODO: implement this
return false;
case PASSABLE_PATHANDFIELD:
return (map.getField(pTileColumn, pTileRow).hostsEntity() && !map.getField(pTileColumn, pTileRow).getHostedEntity().getGraphic().startsWith("path"))
|| map.getField(pTileColumn, pTileRow).getFloorEntity().getGraphic().startsWith("water");
case PASSABLE_WATERONLY:
return !map.getField(pTileColumn, pTileRow).getFloorEntity().getGraphic().equalsIgnoreCase("water");
}
}
return false;
}
@Override
public float getStepCost(Map pEntity, int pFromTileColumn, int pFromTileRow, int pToTileColumn, int pToTileRow)
{
return 1; //everything costs the same
}
}
Parsed in 0.037 seconds, using
GeSHi 1.0.8.4
how to find a path:
Using java Syntax Highlighting
this.proxy = new PathfinableMapProxy(map, PathfinableMapProxy.PASSABLE_PATHANDFIELD);
path_pathfinder = new AStarPathFinder<Map>(this.proxy, 100, false);
path_pathfinder.findPath(map, 10000, path_startTileX, path_startTileY, path_curTileX, path_curTileY);
Parsed in 0.031 seconds, using
GeSHi 1.0.8.4
I hope this was helpful
