Initial commit.

This commit is contained in:
cs6601
2012-08-26 11:48:21 -04:00
commit 36291171e5
41 changed files with 2107 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
package cs6601.p1;
public class Command {
public enum TYPE { boardsize, clear_board, final_status_list, genmove, INVALID, komi, list_commands, name, play, quit, version };
private String[] cmdFields;
private String text;
private TYPE type;
public Command(TYPE type, String text, String[] cmdFields) {
this.type = type;
this.text = text;
this.cmdFields = cmdFields;
}
public double getDoubleField(int index) {
return Double.valueOf(cmdFields[index]);
}
public int getIntField(int index) {
return Integer.valueOf(cmdFields[index]);
}
public String getStringField(int index) {
return cmdFields[index];
}
public String getText() {
return text;
}
public TYPE getType() {
return type;
}
public String toString() {
return "[" + type.toString() + "] " + text;
}
}