package background.commands;

import background.CommandManager;

public class Question extends Command {

	public Question(CommandManager cm) {super(cm); }
	public Question(Boolean viz, CommandManager cm) {super(viz, cm);}

	public String question;
	public String answer; 
	public String variable = "";
	
	@Override
	public String getType() {
		return "Question";
	}
	
	@Override
	public void applyCommand() {
		commandManager.timer.cancel();		
		if (!variable.isEmpty()) {answer = commandManager.variableManager.getVariableByName(variable).getValue("string");}
		commandManager.correctAnswer.setText(answer);
		
		commandManager.questionArea.setText(commandManager.questionArea.getText().replace("question", question));
		commandManager.questionPanel.setVisible(true);
	}
	
}
