OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
context.hpp
Go to the documentation of this file.
1 #ifndef INTERPRETER_CONTEXT_H_INCLUDED
2 #define INTERPRETER_CONTEXT_H_INCLUDED
3 
4 #include <string>
5 #include <vector>
6 
7 namespace Interpreter
8 {
9  class Context
10  {
11  public:
12 
13  virtual ~Context() {}
14 
15  virtual int getLocalShort (int index) const = 0;
16 
17  virtual int getLocalLong (int index) const = 0;
18 
19  virtual float getLocalFloat (int index) const = 0;
20 
21  virtual void setLocalShort (int index, int value) = 0;
22 
23  virtual void setLocalLong (int index, int value) = 0;
24 
25  virtual void setLocalFloat (int index, float value) = 0;
26 
27  virtual void messageBox (const std::string& message,
28  const std::vector<std::string>& buttons) = 0;
29 
30  void messageBox (const std::string& message)
31  {
32  std::vector<std::string> empty;
33  messageBox (message, empty);
34  }
35 
36  virtual void report (const std::string& message) = 0;
37 
38  virtual bool menuMode() = 0;
39 
40  virtual int getGlobalShort (const std::string& name) const = 0;
41 
42  virtual int getGlobalLong (const std::string& name) const = 0;
43 
44  virtual float getGlobalFloat (const std::string& name) const = 0;
45 
46  virtual void setGlobalShort (const std::string& name, int value) = 0;
47 
48  virtual void setGlobalLong (const std::string& name, int value) = 0;
49 
50  virtual void setGlobalFloat (const std::string& name, float value) = 0;
51 
52  virtual std::vector<std::string> getGlobals () const = 0;
53 
54  virtual char getGlobalType (const std::string& name) const = 0;
55 
56  virtual std::string getActionBinding(const std::string& action) const = 0;
57 
58  virtual std::string getNPCName() const = 0;
59 
60  virtual std::string getNPCRace() const = 0;
61 
62  virtual std::string getNPCClass() const = 0;
63 
64  virtual std::string getNPCFaction() const = 0;
65 
66  virtual std::string getNPCRank() const = 0;
67 
68  virtual std::string getPCName() const = 0;
69 
70  virtual std::string getPCRace() const = 0;
71 
72  virtual std::string getPCClass() const = 0;
73 
74  virtual std::string getPCRank() const = 0;
75 
76  virtual std::string getPCNextRank() const = 0;
77 
78  virtual int getPCBounty() const = 0;
79 
80  virtual std::string getCurrentCellName() const = 0;
81 
82  virtual bool isScriptRunning (const std::string& name) const = 0;
83 
84  virtual void startScript (const std::string& name, const std::string& targetId = "") = 0;
85 
86  virtual void stopScript (const std::string& name) = 0;
87 
88  virtual float getDistance (const std::string& name, const std::string& id = "") const
89  = 0;
90 
91  virtual float getSecondsPassed() const = 0;
92 
93  virtual bool isDisabled (const std::string& id = "") const = 0;
94 
95  virtual void enable (const std::string& id = "") = 0;
96 
97  virtual void disable (const std::string& id = "") = 0;
98 
99  virtual int getMemberShort (const std::string& id, const std::string& name, bool global) const = 0;
100 
101  virtual int getMemberLong (const std::string& id, const std::string& name, bool global) const = 0;
102 
103  virtual float getMemberFloat (const std::string& id, const std::string& name, bool global) const = 0;
104 
105  virtual void setMemberShort (const std::string& id, const std::string& name, int value, bool global) = 0;
106 
107  virtual void setMemberLong (const std::string& id, const std::string& name, int value, bool global) = 0;
108 
109  virtual void setMemberFloat (const std::string& id, const std::string& name, float value, bool global)
110  = 0;
111 
112  virtual std::string getTargetId() const = 0;
113  };
114 }
115 
116 #endif
virtual void enable(const std::string &id="")=0
virtual void setMemberShort(const std::string &id, const std::string &name, int value, bool global)=0
virtual int getPCBounty() const =0
void message(CodeContainer &code, Literals &literals, const std::string &message, int buttons)
Definition: generator.cpp:537
virtual std::string getTargetId() const =0
virtual std::string getActionBinding(const std::string &action) const =0
virtual float getLocalFloat(int index) const =0
virtual std::string getNPCRace() const =0
virtual float getDistance(const std::string &name, const std::string &id="") const =0
virtual void setGlobalFloat(const std::string &name, float value)=0
virtual std::string getPCNextRank() const =0
virtual void setMemberFloat(const std::string &id, const std::string &name, float value, bool global)=0
virtual std::string getNPCName() const =0
virtual std::string getPCRace() const =0
virtual int getLocalLong(int index) const =0
virtual std::string getPCRank() const =0
virtual void setMemberLong(const std::string &id, const std::string &name, int value, bool global)=0
virtual int getMemberShort(const std::string &id, const std::string &name, bool global) const =0
virtual bool isDisabled(const std::string &id="") const =0
virtual int getMemberLong(const std::string &id, const std::string &name, bool global) const =0
virtual std::string getCurrentCellName() const =0
virtual float getMemberFloat(const std::string &id, const std::string &name, bool global) const =0
virtual ~Context()
Definition: context.hpp:13
Definition: context.hpp:9
virtual int getGlobalLong(const std::string &name) const =0
virtual void messageBox(const std::string &message, const std::vector< std::string > &buttons)=0
virtual void setLocalFloat(int index, float value)=0
virtual float getGlobalFloat(const std::string &name) const =0
virtual int getGlobalShort(const std::string &name) const =0
virtual void setLocalLong(int index, int value)=0
virtual void setGlobalLong(const std::string &name, int value)=0
virtual void startScript(const std::string &name, const std::string &targetId="")=0
virtual int getLocalShort(int index) const =0
virtual std::string getNPCRank() const =0
virtual void setGlobalShort(const std::string &name, int value)=0
virtual std::string getNPCFaction() const =0
virtual float getSecondsPassed() const =0
virtual std::string getPCName() const =0
virtual void setLocalShort(int index, int value)=0
virtual std::vector< std::string > getGlobals() const =0
virtual std::string getNPCClass() const =0
void messageBox(const std::string &message)
Definition: context.hpp:30
virtual void stopScript(const std::string &name)=0
virtual void disable(const std::string &id="")=0
virtual bool isScriptRunning(const std::string &name) const =0
virtual bool menuMode()=0
virtual char getGlobalType(const std::string &name) const =0
virtual void report(const std::string &message)=0
virtual std::string getPCClass() const =0
const char * name
Definition: crashcatcher.cpp:59