C:/Documents and Settings/mtauraso/Desktop/proj3/projectX/SetCutSceneCommand.cpp

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

Generated on Sat Apr 22 15:05:20 2006 for ProjectX by  doxygen 1.4.6-NO