Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void processCommand(String string){
- String comName = (parser.getCommand(string)== null)?"":parser.getCommand(string).getName();
- if(parser.getCommand(string) == null) {
- System.out.println("Taky prikaz nepoznam");
- }
- else if (comName.equals("PRESKUMAJ") || (comName.equals("VEZMI")) ||
- (comName.equals("POLOZ")) || (comName.equals("POUZI"))){
- parser.getCommand(string).execute(this, string.substring(((comName.length()+1)>string.length()) ? string.length() : comName.length()+1, string.length()));
- History.getInstance().add(string);
- }
- else if (comName.equals("ULOZ")){
- parser.getCommand(string).execute(this, string.substring(((comName.length()+1)>string.length()) ? string.length() : comName.length()+1, string.length()));
- }
- else if (comName.equals("NACITAJ")){
- init();
- gameState = GameState.PLAYING;
- parser.getCommand(string).execute(this, string.substring(((comName.length()+1)>string.length()) ? string.length() : comName.length()+1, string.length()));
- List<String> tempHistory = new ArrayList<String>();
- for(String command : History.historyCommands) {
- innerProcessCommand(command);
- tempHistory.add(command);
- }
- History.historyCommands = tempHistory;
- }
- else {
- parser.getCommand(string).execute(this, string);
- History.getInstance().add(string);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment