2011-12-13 21:23:17 +00:00
|
|
|
/*
|
|
|
|
|
* CScriptingModule.h, part of VCMI engine
|
|
|
|
|
*
|
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
|
*
|
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
|
*
|
|
|
|
|
*/
|
2017-07-13 11:26:03 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
2022-09-21 19:31:14 +03:00
|
|
|
#if SCRIPTING_ENABLED
|
2018-03-17 17:58:30 +03:00
|
|
|
#include <vcmi/scripting/Service.h>
|
2011-12-13 21:23:17 +00:00
|
|
|
|
2022-07-26 16:07:42 +03:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
2018-03-17 17:58:30 +03:00
|
|
|
namespace spells
|
|
|
|
|
{
|
|
|
|
|
namespace effects
|
|
|
|
|
{
|
|
|
|
|
class Registry;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-04-20 11:13:37 +04:00
|
|
|
|
2018-03-17 17:58:30 +03:00
|
|
|
namespace scripting
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
class DLL_LINKAGE ContextBase : public Context
|
2011-06-20 11:41:04 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2018-03-17 17:58:30 +03:00
|
|
|
ContextBase(vstd::CLoggerBase * logger_);
|
2023-03-14 00:26:44 +03:00
|
|
|
virtual ~ContextBase() = default;
|
|
|
|
|
|
2018-03-17 17:58:30 +03:00
|
|
|
protected:
|
|
|
|
|
vstd::CLoggerBase * logger;
|
2014-04-19 21:44:21 +04:00
|
|
|
};
|
2014-04-20 12:40:15 +04:00
|
|
|
|
2018-03-17 17:58:30 +03:00
|
|
|
class DLL_LINKAGE Module
|
|
|
|
|
{
|
|
|
|
|
public:
|
2023-03-14 00:26:44 +03:00
|
|
|
Module() = default;
|
|
|
|
|
virtual ~Module() = default;
|
2018-03-17 17:58:30 +03:00
|
|
|
|
|
|
|
|
virtual std::string compile(const std::string & name, const std::string & source, vstd::CLoggerBase * logger) const = 0;
|
|
|
|
|
|
|
|
|
|
virtual std::shared_ptr<ContextBase> createContextFor(const Script * source, const Environment * env) const = 0;
|
|
|
|
|
|
|
|
|
|
virtual void registerSpellEffect(spells::effects::Registry * registry, const Script * source) const = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
2022-07-26 16:07:42 +03:00
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|
2022-09-21 19:31:14 +03:00
|
|
|
#endif
|