#include "Command.h"
#include "List.h"
#include "Level.h"

using namespace std;

const std::string SetCutSceneCommand::_id = "setCutScene";

SetCutSceneCommand::SetCutSceneCommand(bool cutScene)
:_cutScene(cutScene)
{

}

SetCutSceneCommand::SetCutSceneCommand(List *command)
{
	command = command->rest();
	string cutScene = command->firstString();
	if(cutScene == "true")
		_cutScene = true;
	else
		_cutScene = false;
}

void SetCutSceneCommand::execute()
{
	Level::instance()->setCutScene(_cutScene);
}

std::string SetCutSceneCommand::getString()
{
	List *command = new List();
	command->snoc(new Atom(_id));
	if(_cutScene)
		command->snoc(new Atom("true"));
	else
		command->snoc(new Atom("false"));
	string commandString = command->getString();
	delete command;

	return commandString;
}