Anonymous avatar Anonymous committed 74586e8

Eliminato il comando fine e corretta la gestione della fine del gioco.

Comments (0)

Files changed (1)

src/it/uniroma3/diadia/DiaDia.java

         Comando comando = new Comando(istruzione);
 
         if (comando.is("fine")) {
-            this.fine(); 
-            return true;
+            this.partita.setFinita();
         } else if (comando.is("vai")) {
             this.vai(comando.getParametro());
         } else if (comando.is("aiuto")) {
         System.out.println(partita.getStanzaCorrente().getNome());
     }
 
-    /**
-     * Comando "Fine".
-     */
-    private void fine() {
-        System.out.println("Grazie di aver giocato!");  // si desidera smettere
-    }
-
     public static void main(String[] argc) {
         DiaDia gioco = new DiaDia();
         gioco.gioca();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.