Moves the given place to the new x/y coordinates on the place's layer. @param place @param x @param y @return True if the place was moved
(final Place place, final int x, final int y)
| 239 | * @return True if the place was moved |
| 240 | */ |
| 241 | public static boolean move(final Place place, final int x, final int y) { |
| 242 | try { |
| 243 | final Layer layer = place.getLayer(); |
| 244 | if (layer.get(x, y) != null) { |
| 245 | return false; |
| 246 | } |
| 247 | layer.remove(place); |
| 248 | layer.put(place, x, y); |
| 249 | return true; |
| 250 | } catch (final Exception e) { |
| 251 | Logger.getLogger(Mudmap2.class.getName()).log(Level.SEVERE, null, e); |
| 252 | return false; |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | /** |
| 257 | * Returns true, if there are places to paste |