- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# C:/Documents and Settings/jegan/Desktop/projectX/Command.cpp

Go to the documentation of this file.

    00001 #include "Command.h"
    00002 #include "List.h"
    00003
    00004 using namespace std;
    00005
    00006 Command *Command::loadCommand(List *command)
    00007 {
    00008         Command *newCommand;
    00009
    00010         if(command->firstString() == JumpCommand::id())
    00011                 newCommand = new JumpCommand(command);
    00012         else if(command->firstString() == JumpResetCommand::id())
    00013                 newCommand = new JumpResetCommand(command);
    00014         else if(command->firstString() == MoveCommand::id())
    00015                 newCommand = new MoveCommand(command);
    00016         else if(command->firstString() == TurnCommand::id())
    00017                 newCommand = new TurnCommand(command);
    00018         else if(command->firstString() == PlayMusicCommand::id())
    00019                 newCommand = new PlayMusicCommand(command);
    00020         else if(command->firstString() == PlaySoundCommand::id())
    00021                 newCommand = new PlaySoundCommand(command);
    00022         else if(command->firstString() == FollowPlayerCommand::id())
    00023                 newCommand = new FollowPlayerCommand(command);
    00024         else if(command->firstString() == FollowPlayerInRangeCommand::id())
    00025                 newCommand = new FollowPlayerInRangeCommand(command);
    00026         else if(command->firstString() == ShootCommand::id())
    00027                 newCommand = new ShootCommand(command);
    00028         else if(command->firstString() == SecondaryShootCommand::id())
    00029                 newCommand = new SecondaryShootCommand(command);
    00030         else if(command->firstString() == ShootInRangeCommand::id())
    00031                 newCommand = new ShootInRangeCommand(command);
    00032         else if(command->firstString() == CutSceneTextCommand::id())
    00033                 newCommand = new CutSceneTextCommand(command);
    00034         else if(command->firstString() == SetCameraCommand::id())
    00035                 newCommand = new SetCameraCommand(command);
    00036         else if(command->firstString() == SetControlCommand::id())
    00037                 newCommand = new SetControlCommand(command);
    00038         else if(command->firstString() == PlayScriptCommand::id())
    00039                 newCommand = new PlayScriptCommand(command);
    00040         else if(command->firstString() == AimCommand::id())
    00041                 newCommand = new AimCommand(command);
    00042         else if(command->firstString() == SetCutSceneCommand::id())
    00043                 newCommand = new SetCutSceneCommand(command);
    00044         else if(command->firstString() == AddHealthCommand::id())
    00045                 newCommand = new AddHealthCommand(command);
    00046         else if(command->firstString() == AddWeaponCommand::id())
    00047                 newCommand = new AddWeaponCommand(command);
    00048         else if(command->firstString() == SetDoorLockCommand::id())
    00049                 newCommand = new SetDoorLockCommand(command);
    00050         else if(command->firstString() == AddScoreCommand::id())
    00051                 newCommand = new AddScoreCommand(command);
    00052         else if(command->firstString() == EndLevelCommand::id())
    00053                 newCommand = new EndLevelCommand(command);
    00054         else if(command->firstString() == StopPersonCommand::id())
    00055                 newCommand = new StopPersonCommand(command);
    00056         else if(command->firstString() == CrouchCommand::id())
    00057                 newCommand = new CrouchCommand(command);
    00058         else if(command->firstString() == SaveCommand::id())
    00059                 newCommand = new SaveCommand(command);
    00060         else if(command->firstString() == RestoreCommand::id())
    00061                 newCommand = new RestoreCommand(command);
    00062         else if(command->firstString() == SetPositionCommand::id())
    00063                 newCommand = new SetPositionCommand(command);
    00064         else if(command->firstString() == ActivateCutSceneCommand::id())
    00065                 newCommand = new ActivateCutSceneCommand(command);
    00066         else if(command->firstString() == KillCommand::id())
    00067                 newCommand = new KillCommand(command);
    00068         else if(command->firstString() == ActivateEnemyCommand::id())
    00069                 newCommand = new ActivateEnemyCommand(command);
    00070         else if(command->firstString() == InvincibleCommand::id())
    00071                 newCommand = new InvincibleCommand(command);
    00072         else if(command->firstString() == FlushCommand::id())
    00073                 newCommand = new FlushCommand(command);
    00074         else if(command->firstString() == LiveCommand::id())
    00075                 newCommand = new LiveCommand(command);
    00076
    00077         else
    00078                 cerr << "Unknown command type: " << command->firstString() << endl;
    00079
    00080         return newCommand;
    00081 }