Example #1
0
 public void continueMatch(int id) {
   // Continua una partida guardada
   SimpleEntry<
           Integer,
           SimpleEntry<
               Integer, SimpleEntry<String, SimpleEntry<String, SimpleEntry<String, Integer>>>>>
       savedMatch = dataController.getSavedMatch(id, currentUser.username);
   match = new Match();
   match.setTime((int) (System.currentTimeMillis() - (savedMatch.getKey() * 1000)));
   match.setIdBoard(savedMatch.getValue().getKey());
   match.setHintsRemaining(savedMatch.getValue().getValue().getValue().getValue().getValue());
   int size =
       (int) Math.sqrt(Math.sqrt((savedMatch.getValue().getValue().getKey().length() + 1) / 2));
   match.setBoardSolved(new SudokuBoard(savedMatch.getValue().getValue().getKey(), size));
   match.setGame(new SudokuGame(savedMatch.getValue().getValue().getValue().getKey(), size));
   match.setInitialState(
       new SudokuBoard(savedMatch.getValue().getValue().getValue().getValue().getKey(), size));
 }