Esempio n. 1
0
 public void newGame(View v) {
   game.flagEN = dictionaryEnglish;
   if (dictionaryEnglish) { // reset and load the english lexicon
     if (lexicon == null) { // only create an english lexicon if it doesn't exist already
       lexicon = new Lexicon(getApplicationContext(), "english.txt");
     } else {
       lexicon.reset();
     }
     game.lexicon = lexicon;
   } else { // reload the alternative (dutch) lexicon
     if (alt_lexicon == null) { // only create an alternative lexicon if it doesn't exist already
       alt_lexicon = new Lexicon(getApplicationContext(), "dutch.txt");
     } else {
       alt_lexicon.reset();
     }
     game.lexicon = alt_lexicon;
   }
   game.resetGame();
   updateView();
   // if button was fired from settings menu, toggle settings fragment
   if (v == null || v.getId() == R.id.newGame_settings) toggleSettings();
   // save new game
   new AsyncSaveGame(this).execute(game);
 }