C:/Documents and Settings/jegan/Desktop/projectX/ActivateCutSceneCommand.cpp

Go to the documentation of this file.
00001 #include "Command.h"
00002 #include "Control.h"
00003 #include "List.h"
00004 #include "Level.h"
00005 #include "Object.h"
00006 #include "CutScene.h"
00007 
00008 using namespace std;
00009 
00010 const std::string ActivateCutSceneCommand::_id = "activateCutScene";
00011 
00012 ActivateCutSceneCommand::ActivateCutSceneCommand(CutScene *cutScene)
00013 :_cutScene(cutScene->id())
00014 {
00015 
00016 }
00017 
00018 ActivateCutSceneCommand::ActivateCutSceneCommand(List *command)
00019 {
00020         command = command->rest();
00021         _cutScene = command->firstString();
00022 }
00023 
00024 void ActivateCutSceneCommand::execute()
00025 {
00026         ((CutScene *)Level::instance()->getObject(_cutScene))->activate();
00027 }
00028 
00029 std::string ActivateCutSceneCommand::getString()
00030 {
00031         List *command = new List();
00032         command->snoc(new Atom(_id));
00033         command->snoc(new Atom(_cutScene));
00034         string commandString = command->getString();
00035         delete command;
00036 
00037         return commandString;
00038 }

Generated on Fri May 5 00:20:18 2006 for ProjectX by  doxygen 1.4.6-NO