C:/Documents and Settings/jegan/Desktop/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         Screen::instance()->recenter();
00027 }
00028 
00029 std::string SetCameraCommand::getString()
00030 {
00031         List *command = new List();
00032         command->snoc(new Atom(_id));
00033         command->snoc(new Atom(_object->id()));
00034         string commandString = command->getString();
00035         delete command;
00036 
00037         return commandString;
00038 }

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