/** * Must use this when setting a new path in order to avoid loosing reference to the targetPath object * (it's destructor method won't be called if the reference is changed, so the previous path may never be * "deselected" if the reference is disconnected) */ protected void setPath(Path path) { targetPath.setNewTileQueue(path.getTilePath()); if (isSelected()) targetPath.selectPath(); }