OpenMW
components/interpreter/context.hpp
Go to the documentation of this file.
00001 #ifndef INTERPRETER_CONTEXT_H_INCLUDED
00002 #define INTERPRETER_CONTEXT_H_INCLUDED
00003 
00004 #include <string>
00005 #include <vector>
00006 
00007 namespace Interpreter
00008 {
00009     class Context
00010     {
00011         public:
00012 
00013             virtual ~Context() {}
00014 
00015             virtual int getLocalShort (int index) const = 0;
00016 
00017             virtual int getLocalLong (int index) const = 0;
00018 
00019             virtual float getLocalFloat (int index) const = 0;
00020 
00021             virtual void setLocalShort (int index, int value) = 0;
00022 
00023             virtual void setLocalLong (int index, int value) = 0;
00024 
00025             virtual void setLocalFloat (int index, float value) = 0;
00026 
00027             virtual void messageBox (const std::string& message,
00028                 const std::vector<std::string>& buttons) = 0;
00029 
00030             void messageBox (const std::string& message)
00031             {
00032                 std::vector<std::string> empty;
00033                 messageBox (message, empty);
00034             }
00035 
00036             virtual void report (const std::string& message) = 0;
00037 
00038             virtual bool menuMode() = 0;
00039 
00040             virtual int getGlobalShort (const std::string& name) const = 0;
00041 
00042             virtual int getGlobalLong (const std::string& name) const = 0;
00043 
00044             virtual float getGlobalFloat (const std::string& name) const = 0;
00045 
00046             virtual void setGlobalShort (const std::string& name, int value) = 0;
00047 
00048             virtual void setGlobalLong (const std::string& name, int value) = 0;
00049 
00050             virtual void setGlobalFloat (const std::string& name, float value) = 0;
00051 
00052             virtual std::vector<std::string> getGlobals () const = 0;
00053             
00054             virtual char getGlobalType (const std::string& name) const = 0;
00055 
00056             virtual std::string getActionBinding(const std::string& action) const = 0;
00057             
00058             virtual std::string getNPCName() const = 0;
00059             
00060             virtual std::string getNPCRace() const = 0;
00061             
00062             virtual std::string getNPCClass() const = 0;
00063             
00064             virtual std::string getNPCFaction() const = 0;
00065             
00066             virtual std::string getNPCRank() const = 0;
00067 
00068             virtual std::string getPCName() const = 0;
00069             
00070             virtual std::string getPCRace() const = 0;
00071             
00072             virtual std::string getPCClass() const = 0;
00073             
00074             virtual std::string getPCRank() const = 0;
00075             
00076             virtual std::string getPCNextRank() const = 0;
00077             
00078             virtual int getPCBounty() const = 0;
00079             
00080             virtual std::string getCurrentCellName() const = 0;
00081 
00082             virtual bool isScriptRunning (const std::string& name) const = 0;
00083 
00084             virtual void startScript (const std::string& name) = 0;
00085 
00086             virtual void stopScript (const std::string& name) = 0;
00087 
00088             virtual float getDistance (const std::string& name, const std::string& id = "") const
00089                  = 0;
00090 
00091             virtual float getSecondsPassed() const = 0;
00092 
00093             virtual bool isDisabled (const std::string& id = "") const = 0;
00094 
00095             virtual void enable (const std::string& id = "") = 0;
00096 
00097             virtual void disable (const std::string& id = "") = 0;
00098 
00099             virtual int getMemberShort (const std::string& id, const std::string& name) const = 0;
00100 
00101             virtual int getMemberLong (const std::string& id, const std::string& name) const = 0;
00102 
00103             virtual float getMemberFloat (const std::string& id, const std::string& name) const = 0;
00104 
00105             virtual void setMemberShort (const std::string& id, const std::string& name, int value) = 0;
00106 
00107             virtual void setMemberLong (const std::string& id, const std::string& name, int value) = 0;
00108 
00109             virtual void setMemberFloat (const std::string& id, const std::string& name, float value)
00110                 = 0;
00111     };
00112 }
00113 
00114 #endif