public void merge(Tile another) { getStyleClass().remove("tile-" + value); this.value += another.getValue(); setText(value.toString()); merged = true; getStyleClass().add("tile-" + value); }
public boolean isMergeable(Tile anotherTile) { return anotherTile != null && getValue().equals(anotherTile.getValue()); }