Вроде уже применил Integer.compare, но все равно не пропускает. Менял местами значения. Не проходит. Может я не вижу ошибку в логике?
@Override
public int compareTo(MoveEfficiency o) {
if (Integer.compare(this.numberOfEmptyTiles, o.numberOfEmptyTiles) > 0)
return 1;
if (Integer.compare(this.score, o.score) > 0)
return 1;
return 0;
}
Нет сил уже!package com.javarush.task.task35.task3513;
import javax.swing.*;
public class Main {
public static void main(String[] args) {
Model model = new Model();
Controller controller = new Controller(model);
JFrame game = new JFrame();
game.setTitle("2048");
game.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
game.setSize(450, 500);
game.setResizable(false);
game.add(controller.getView());
game.setLocationRelativeTo(null);
game.setVisible(true);
}
}