2010-06-28 17:20:45 +00:00
|
|
|
#ifndef INTERPRETER_CONTEXT_H_INCLUDED
|
|
|
|
#define INTERPRETER_CONTEXT_H_INCLUDED
|
|
|
|
|
2010-07-02 16:08:00 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2010-06-28 17:20:45 +00:00
|
|
|
namespace Interpreter
|
|
|
|
{
|
|
|
|
class Context
|
|
|
|
{
|
2010-06-28 18:07:17 +00:00
|
|
|
public:
|
|
|
|
|
2018-07-22 21:46:07 +00:00
|
|
|
/*
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
|
|
|
Keep an enumeration of the possible context types
|
|
|
|
*/
|
|
|
|
enum CONTEXT_TYPE
|
|
|
|
{
|
|
|
|
CONSOLE = 0,
|
|
|
|
DIALOGUE = 1,
|
|
|
|
SCRIPT_LOCAL = 2,
|
|
|
|
SCRIPT_GLOBAL = 3
|
|
|
|
};
|
|
|
|
/*
|
|
|
|
End of tes3mp addition
|
|
|
|
*/
|
|
|
|
|
2010-06-28 18:07:17 +00:00
|
|
|
virtual ~Context() {}
|
|
|
|
|
|
|
|
virtual int getLocalShort (int index) const = 0;
|
|
|
|
|
|
|
|
virtual int getLocalLong (int index) const = 0;
|
|
|
|
|
|
|
|
virtual float getLocalFloat (int index) const = 0;
|
|
|
|
|
2011-04-26 19:48:13 +00:00
|
|
|
virtual void setLocalShort (int index, int value) = 0;
|
2010-06-28 18:07:17 +00:00
|
|
|
|
2011-04-26 19:48:13 +00:00
|
|
|
virtual void setLocalLong (int index, int value) = 0;
|
2010-06-28 18:07:17 +00:00
|
|
|
|
2010-06-30 10:04:26 +00:00
|
|
|
virtual void setLocalFloat (int index, float value) = 0;
|
2011-04-26 19:48:13 +00:00
|
|
|
|
2010-06-30 10:04:26 +00:00
|
|
|
virtual void messageBox (const std::string& message,
|
2011-04-26 19:48:13 +00:00
|
|
|
const std::vector<std::string>& buttons) = 0;
|
|
|
|
|
2010-07-03 13:04:00 +00:00
|
|
|
void messageBox (const std::string& message)
|
|
|
|
{
|
|
|
|
std::vector<std::string> empty;
|
|
|
|
messageBox (message, empty);
|
|
|
|
}
|
2011-04-26 19:48:13 +00:00
|
|
|
|
|
|
|
virtual void report (const std::string& message) = 0;
|
|
|
|
|
2010-07-04 10:29:28 +00:00
|
|
|
virtual int getGlobalShort (const std::string& name) const = 0;
|
|
|
|
|
|
|
|
virtual int getGlobalLong (const std::string& name) const = 0;
|
|
|
|
|
|
|
|
virtual float getGlobalFloat (const std::string& name) const = 0;
|
|
|
|
|
2011-04-26 19:48:13 +00:00
|
|
|
virtual void setGlobalShort (const std::string& name, int value) = 0;
|
2010-07-04 10:29:28 +00:00
|
|
|
|
2011-04-26 19:48:13 +00:00
|
|
|
virtual void setGlobalLong (const std::string& name, int value) = 0;
|
|
|
|
|
|
|
|
virtual void setGlobalFloat (const std::string& name, float value) = 0;
|
2010-07-04 10:29:28 +00:00
|
|
|
|
2012-12-20 23:16:34 +00:00
|
|
|
virtual std::vector<std::string> getGlobals () const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-20 23:16:34 +00:00
|
|
|
virtual char getGlobalType (const std::string& name) const = 0;
|
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getActionBinding(const std::string& action) const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2018-09-16 16:47:51 +00:00
|
|
|
virtual std::string getActorName() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getNPCRace() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getNPCClass() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getNPCFaction() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getNPCRank() const = 0;
|
|
|
|
|
|
|
|
virtual std::string getPCName() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getPCRace() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getPCClass() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getPCRank() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getPCNextRank() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual int getPCBounty() const = 0;
|
2014-02-10 13:45:55 +00:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getCurrentCellName() const = 0;
|
|
|
|
|
2014-02-10 13:45:55 +00:00
|
|
|
virtual int getMemberShort (const std::string& id, const std::string& name, bool global) const = 0;
|
2012-06-07 09:59:45 +00:00
|
|
|
|
2014-02-10 13:45:55 +00:00
|
|
|
virtual int getMemberLong (const std::string& id, const std::string& name, bool global) const = 0;
|
2012-06-07 09:59:45 +00:00
|
|
|
|
2014-02-10 13:45:55 +00:00
|
|
|
virtual float getMemberFloat (const std::string& id, const std::string& name, bool global) const = 0;
|
2012-06-07 09:59:45 +00:00
|
|
|
|
2014-02-10 13:45:55 +00:00
|
|
|
virtual void setMemberShort (const std::string& id, const std::string& name, int value, bool global) = 0;
|
2012-06-07 09:59:45 +00:00
|
|
|
|
2014-02-10 13:45:55 +00:00
|
|
|
virtual void setMemberLong (const std::string& id, const std::string& name, int value, bool global) = 0;
|
2012-06-07 09:59:45 +00:00
|
|
|
|
2014-02-10 13:45:55 +00:00
|
|
|
virtual void setMemberFloat (const std::string& id, const std::string& name, float value, bool global)
|
2012-06-07 09:59:45 +00:00
|
|
|
= 0;
|
2014-07-17 11:36:55 +00:00
|
|
|
|
2018-07-22 21:46:07 +00:00
|
|
|
/*
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
2020-07-27 07:17:22 +00:00
|
|
|
Used for tracking and checking the type of this Context, as well as
|
|
|
|
its current script
|
2018-07-22 21:46:07 +00:00
|
|
|
*/
|
|
|
|
virtual unsigned short getContextType() const = 0;
|
2020-07-27 07:17:22 +00:00
|
|
|
virtual std::string getCurrentScriptName() const = 0;
|
2020-07-26 18:03:33 +00:00
|
|
|
virtual void trackContextType(unsigned short interpreterType) = 0;
|
2020-07-27 07:17:22 +00:00
|
|
|
virtual void trackCurrentScriptName(const std::string& name) = 0;
|
2018-07-22 21:46:07 +00:00
|
|
|
/*
|
|
|
|
End of tes3mp addition
|
|
|
|
*/
|
2010-06-28 17:20:45 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|