public boolean blocked(PathFindingContext context, int tx, int ty) { if ((tx < 0) || (ty < 0) || (tx >= 50) || (ty >= 50)) { return false; } return map[tx+(ty*50)] != 0; }
/** * {@inheritDoc} */ @Override public boolean blocked(PathFindingContext context, int tx, int ty) { // TODO How to use PathFindingContext? try { int tileID = map.getTileId(tx, ty, blockedLayerID); String property = map.getTileProperty(tileID, "blocked", "false"); return !property.equals("false"); } catch (ArrayIndexOutOfBoundsException e) { return true; } }
/** * Considered if its wall of if there are a person when its in perception range * @param ctx * @param x * @param y * @return */ @Override public boolean blocked(PathFindingContext ctx, int x, int y) { if(PositionTools.isWall(p, x, y)) return true; if(PositionTools.getDistance(p.getPosition().x, p.getPosition().y, x, y)<percetionRange){ return PositionTools.getPerson(p, x, y)!=null; } return false; }
/** * Considered if its wall of if there is a person in its in perception range (so calling it when finding a mobile object, generates a path considering this) * @param ctx * @param x * @param y * @return */ @Override public boolean blocked(PathFindingContext ctx, int x, int y) { if(x>=WIDTH ||x<0 ||y<0 || y>= HEIGHT) return true; if(bmap[x][y]) return true; if(PositionTools.getDistance(p.getPosition().x, p.getPosition().y, x, y)<percetionRange){ if(PositionTools.getPerson(p, x, y)!=null) return true; } return false; }
public float getCost(PathFindingContext context, int tx, int ty) { return 1; }
public boolean blocked(PathFindingContext context, int tx, int ty) { return walls[tx][ty]; }
public float getCost(PathFindingContext context, int tx, int ty) { return 0; }
public boolean blocked(PathFindingContext context, int tx, int ty) { return !isFree(tx, ty); }
@Override public boolean blocked(PathFindingContext context, int tx, int ty) { return blocked[tx][ty]; }
@Override public float getCost(PathFindingContext context, int tx, int ty) { return 0; }
@Override public boolean blocked(PathFindingContext arg0, int x, int y) { return !((MobileEntity) arg0.getMover()).canEnterCell(new Pos(x, y)); }
@Override public float getCost(PathFindingContext ctx, int x, int y) { return 1; }
@Override public boolean blocked(PathFindingContext context, int x, int y) { return blocked[x][y]; }
@Override public float getCost(PathFindingContext arg0, int arg1, int arg2) { return 0; }
/** * {@inheritDoc} */ @Override public float getCost(PathFindingContext context, int tx, int ty) { return 1; }
@Override public float getCost(PathFindingContext ctx, int x, int y) { return 1.0f; }
@Override //0 is blocked public boolean blocked(PathFindingContext ctx, int x, int y) { return MAP[y][x] != 0; }
@Override public boolean blocked(PathFindingContext arg0, int x, int y) { return blocked[x][y]; }