OpenMW
|
00001 #ifndef INTERPRETER_SCRIPTOPCODES_H_INCLUDED 00002 #define INTERPRETER_SCRIPTOPCODES_H_INCLUDED 00003 00004 #include "opcodes.hpp" 00005 #include "runtime.hpp" 00006 #include "context.hpp" 00007 00008 namespace Interpreter 00009 { 00010 class OpScriptRunning : public Opcode0 00011 { 00012 public: 00013 00014 virtual void execute (Runtime& runtime) 00015 { 00016 std::string name = runtime.getStringLiteral (runtime[0].mInteger); 00017 runtime[0].mInteger = runtime.getContext().isScriptRunning (name); 00018 } 00019 }; 00020 00021 class OpStartScript : public Opcode0 00022 { 00023 public: 00024 00025 virtual void execute (Runtime& runtime) 00026 { 00027 std::string name = runtime.getStringLiteral (runtime[0].mInteger); 00028 runtime.pop(); 00029 runtime.getContext().startScript (name); 00030 } 00031 }; 00032 00033 class OpStopScript : public Opcode0 00034 { 00035 public: 00036 00037 virtual void execute (Runtime& runtime) 00038 { 00039 std::string name = runtime.getStringLiteral (runtime[0].mInteger); 00040 runtime.pop(); 00041 runtime.getContext().stopScript (name); 00042 } 00043 }; 00044 } 00045 00046 #endif 00047