switch(code){
case COMPLEX_MOVE:
int moveToId = Integer.parseInt(words[4].substring(1));
instructions.add(new Instruction(code, agentId, moveToId));
return false;
case ENTER_DOOR:
int doorId = Integer.parseInt(words[3].substring(1));
instructions.add(new Instruction(code, agentId, doorId));
return true;
case OPEN:
case CLOSE:
case USE:
positionId = Integer.parseInt(words[3].substring(1));
instructions.add(new Instruction(code, agentId, positionId));
return false;
case UNLOCK:
case LOCK:
case PICK_UP:
positionId = Integer.parseInt(words[3].substring(1));
int itemId = Integer.parseInt(words[4].substring(1));
instructions.add(
new Instruction(code, agentId, positionId, itemId)
);
return false;
case TAKE_CLOTHES:
positionId = Integer.parseInt(words[3].substring(1));
instructions.add(
new Instruction(code, agentId, positionId)
);
return false;
default:
}