Class Parser

java.lang.Object
  extended by Parser

public class Parser
extends java.lang.Object

Incapsula un interprete di comandi per il gioco jRisk. Fornisce anche delle operazioni di lettura da tastiera per ogni singolo Giocatore.

Version:
1.0.1
Author:
Alessio Treglia

Constructor Summary
Parser()
          Inizializza l'oggetto Parser
 
Method Summary
 Comando getComando()
          Legge dalla tastiera una comando pił gli eventuali argomenti.
 int getInt()
          Legge un int dalla tastiera
 java.lang.String getParola()
          Legge una parola immessa dalla tastiera.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()
Inizializza l'oggetto Parser

Method Detail

getInt

public int getInt()
           throws java.io.IOException
Legge un int dalla tastiera

Returns:
int letto dalla tastiera
Throws:
IOException
java.io.IOException

getParola

public java.lang.String getParola()
                           throws java.io.IOException
Legge una parola immessa dalla tastiera.

Returns:
la parola letta dalla tastiera
Throws:
IOException
java.io.IOException

getComando

public Comando getComando()
Legge dalla tastiera una comando pił gli eventuali argomenti. Se lo riconosce come valido allora crea un oggetto Comando per eseguire l'azione richiesta dall'utente.

Returns:
un oggetto Comando contenente un'azione da eseguire richiesta dall'utente