Beispiel #1
0
 public void restoreUndo() {
   if (!undoList.isEmpty()) {
     UndoState undoState = undoList.removeLast();
     GridCell cell = kenKenGrid.mCells.get(undoState.getCellNum());
     cell.setUserValue(undoState.getUserValue());
     cell.mPossibles = undoState.getPossibles();
     if (undoState.getBatch()) restoreUndo();
   }
   if (undoList.isEmpty()) this.actions[2].setVisibility(View.INVISIBLE);
 }
Beispiel #2
0
  // called by newGameReady, restoreSaveGame and restartGameDialog
  public void startFreshGrid(boolean newGame) {
    undoList.clear();
    clearSelectedButton();

    this.topLayout.setBackgroundColor(BG_COLOURS[theme]);
    this.kenKenGrid.setTheme(theme);
    this.actions[1].setVisibility(View.VISIBLE);
    this.actions[2].setVisibility(View.INVISIBLE);
    titleContainer.setBackgroundResource(R.drawable.menu_button);
    setButtonVisibility(kenKenGrid.mGridSize);

    if (newGame) {
      storeStats(true);
      starttime = System.currentTimeMillis();
      mTimerHandler.postDelayed(playTimer, 0);
    }
  }
Beispiel #3
0
 public void saveUndo(GridCell cell, boolean batch) {
   UndoState undoState =
       new UndoState(cell.mCellNumber, cell.getUserValue(), cell.mPossibles, batch);
   undoList.add(undoState);
   this.actions[2].setVisibility(View.VISIBLE);
 }