-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandWord.java
34 lines (31 loc) · 904 Bytes
/
CommandWord.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Representations for all the valid command words for the game
* along with a string in a particular language.
*
* @author Michael Kölling and David J. Barnes
* @version 2016.02.29
*/
public enum CommandWord
{
// A value for each command word along with its
// corresponding user interface string.
GO("ir"), QUIT("sair"), HELP("ajuda"), UNKNOWN("?"),
PEGAR("pegar"), ANALISAR("analisar"), INVENTARIO("inventario"), FALAR("falar"), ACUSAR("acusar");
// The command string.
private String commandString;
/**
* Initialise with the corresponding command string.
* @param commandString The command string.
*/
CommandWord(String commandString)
{
this.commandString = commandString;
}
/**
* @return The command word as a string.
*/
public String toString()
{
return commandString;
}
}