#include "Command.h"
#include "Control.h"
#include "List.h"
#include "Level.h"
#include "Object.h"
#include "CutScene.h"

using namespace std;

const std::string ActivateCutSceneCommand::_id = "activateCutScene";

ActivateCutSceneCommand::ActivateCutSceneCommand(CutScene *cutScene)
:_cutScene(cutScene->id())
{

}

ActivateCutSceneCommand::ActivateCutSceneCommand(List *command)
{
	command = command->rest();
	_cutScene = command->firstString();
}

void ActivateCutSceneCommand::execute()
{
	((CutScene *)Level::instance()->getObject(_cutScene))->activate();
}

std::string ActivateCutSceneCommand::getString()
{
	List *command = new List();
	command->snoc(new Atom(_id));
	command->snoc(new Atom(_cutScene));
	string commandString = command->getString();
	delete command;

	return commandString;
}