private boolean calculatePosition(final T entity){
  if (shape == null) {
    return true;
  }
  final Rectangle rect=shape.getBounds();
  for (int x=rect.x; x < rect.x + rect.width; x++) {
    for (int y=rect.y; y < rect.y + rect.height; y++) {
      if (shape.contains(x,y)) {
        if (!zone.collides(entity,x,y)) {
          entity.setPosition(x,y);
          return true;
        }
      }
    }
  }
  return false;
}

private boolean calculatePosition ( final T entity ) { if ( shape == null ) { return true ; } final Rectangle rect = shape . getBounds ( ) ; for ( int x = rect . x ; x < rect . x + rect . width ; x ++ ) { for ( int y = rect . y ; y < rect . y + rect . height ; y ++ ) { if ( shape . contains ( x , y ) ) { if ( ! zone . collides ( entity , x , y ) ) { entity . setPosition ( x , y ) ; return true ; } } } } return false ; }
calculates a free spot to place this entity into .
