2010-06-28 19:20:45 +02:00
|
|
|
#ifndef INTERPRETER_CONTEXT_H_INCLUDED
|
|
|
|
#define INTERPRETER_CONTEXT_H_INCLUDED
|
|
|
|
|
2010-07-02 18:08:00 +02:00
|
|
|
#include <string>
|
2022-05-21 10:48:32 +02:00
|
|
|
#include <string_view>
|
2010-07-02 18:08:00 +02:00
|
|
|
#include <vector>
|
|
|
|
|
2010-06-28 19:20:45 +02:00
|
|
|
namespace Interpreter
|
|
|
|
{
|
|
|
|
class Context
|
|
|
|
{
|
2010-06-28 20:07:17 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
virtual ~Context() {}
|
|
|
|
|
2021-02-14 16:25:38 +01:00
|
|
|
virtual std::string getTarget() const = 0;
|
|
|
|
|
2010-06-28 20:07:17 +02:00
|
|
|
virtual int getLocalShort (int index) const = 0;
|
|
|
|
|
|
|
|
virtual int getLocalLong (int index) const = 0;
|
|
|
|
|
|
|
|
virtual float getLocalFloat (int index) const = 0;
|
|
|
|
|
2011-04-26 21:48:13 +02:00
|
|
|
virtual void setLocalShort (int index, int value) = 0;
|
2010-06-28 20:07:17 +02:00
|
|
|
|
2011-04-26 21:48:13 +02:00
|
|
|
virtual void setLocalLong (int index, int value) = 0;
|
2010-06-28 20:07:17 +02:00
|
|
|
|
2010-06-30 12:04:26 +02:00
|
|
|
virtual void setLocalFloat (int index, float value) = 0;
|
2011-04-26 21:48:13 +02:00
|
|
|
|
2010-06-30 12:04:26 +02:00
|
|
|
virtual void messageBox (const std::string& message,
|
2011-04-26 21:48:13 +02:00
|
|
|
const std::vector<std::string>& buttons) = 0;
|
|
|
|
|
2010-07-03 15:04:00 +02:00
|
|
|
void messageBox (const std::string& message)
|
|
|
|
{
|
|
|
|
std::vector<std::string> empty;
|
|
|
|
messageBox (message, empty);
|
|
|
|
}
|
2011-04-26 21:48:13 +02:00
|
|
|
|
|
|
|
virtual void report (const std::string& message) = 0;
|
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual int getGlobalShort(std::string_view name) const = 0;
|
2010-07-04 12:29:28 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual int getGlobalLong(std::string_view name) const = 0;
|
2010-07-04 12:29:28 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual float getGlobalFloat(std::string_view name) const = 0;
|
2010-07-04 12:29:28 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void setGlobalShort(std::string_view name, int value) = 0;
|
2010-07-04 12:29:28 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void setGlobalLong(std::string_view name, int value) = 0;
|
2011-04-26 21:48:13 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void setGlobalFloat(std::string_view name, float value) = 0;
|
2010-07-04 12:29:28 +02:00
|
|
|
|
2012-12-20 23:16:34 +00:00
|
|
|
virtual std::vector<std::string> getGlobals () const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual char getGlobalType(std::string_view name) const = 0;
|
2012-12-20 23:16:34 +00:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual std::string getActionBinding(std::string_view action) const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2018-09-16 20:47:51 +04:00
|
|
|
virtual std::string getActorName() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getNPCRace() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getNPCClass() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getNPCFaction() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getNPCRank() const = 0;
|
|
|
|
|
|
|
|
virtual std::string getPCName() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getPCRace() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getPCClass() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getPCRank() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getPCNextRank() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual int getPCBounty() const = 0;
|
2014-02-10 14:45:55 +01:00
|
|
|
|
2012-12-21 18:09:31 +00:00
|
|
|
virtual std::string getCurrentCellName() const = 0;
|
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual int getMemberShort(std::string_view id, std::string_view name, bool global) const = 0;
|
2012-06-07 11:59:45 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual int getMemberLong(std::string_view id, std::string_view name, bool global) const = 0;
|
2012-06-07 11:59:45 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual float getMemberFloat(std::string_view id, std::string_view name, bool global) const = 0;
|
2012-06-07 11:59:45 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void setMemberShort(std::string_view id, std::string_view name, int value, bool global) = 0;
|
2012-06-07 11:59:45 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void setMemberLong(std::string_view id, std::string_view name, int value, bool global) = 0;
|
2012-06-07 11:59:45 +02:00
|
|
|
|
2022-05-21 01:21:55 +02:00
|
|
|
virtual void setMemberFloat(std::string_view id, std::string_view name, float value, bool global)
|
2012-06-07 11:59:45 +02:00
|
|
|
= 0;
|
2010-06-28 19:20:45 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|