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

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

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