1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/apps/openmw/mwbase/scriptmanager.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.3 KiB
C++
Raw Normal View History

2012-08-09 12:05:47 +02:00
#ifndef GAME_MWBASE_SCRIPTMANAGER_H
#define GAME_MWBASE_SCRIPTMANAGER_H
2022-08-12 20:56:50 +02:00
#include <string_view>
namespace Interpreter
{
class Context;
}
namespace Compiler
{
2021-07-07 18:48:25 +02:00
class Extensions;
class Locals;
}
namespace MWScript
{
class GlobalScripts;
}
namespace MWBase
{
/// \brief Interface for script manager (implemented in MWScript)
class ScriptManager
{
ScriptManager(const ScriptManager&);
///< not implemented
ScriptManager& operator=(const ScriptManager&);
///< not implemented
public:
ScriptManager() {}
virtual ~ScriptManager() {}
virtual void clear() = 0;
virtual bool run(std::string_view name, Interpreter::Context& interpreterContext) = 0;
///< Run the script with the given name (compile first, if not compiled yet)
2022-08-12 20:56:50 +02:00
virtual bool compile(std::string_view name) = 0;
///< Compile script with the given namen
/// \return Success?
2022-08-12 20:56:50 +02:00
virtual std::pair<int, int> compileAll() = 0;
///< Compile all scripts
/// \return count, success
virtual const Compiler::Locals& getLocals(std::string_view name) = 0;
///< Return locals for script \a name.
2022-08-11 22:51:55 +02:00
virtual MWScript::GlobalScripts& getGlobalScripts() = 0;
2021-07-07 18:48:25 +02:00
virtual const Compiler::Extensions& getExtensions() const = 0;
};
}
#endif