CScriptingModule.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * CScriptingModule.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #if SCRIPTING_ENABLED
  12. #include <vcmi/scripting/Service.h>
  13. namespace spells
  14. {
  15. namespace effects
  16. {
  17. class Registry;
  18. }
  19. }
  20. namespace scripting
  21. {
  22. class DLL_LINKAGE ContextBase : public Context
  23. {
  24. public:
  25. ContextBase(vstd::CLoggerBase * logger_);
  26. virtual ~ContextBase();
  27. protected:
  28. vstd::CLoggerBase * logger;
  29. };
  30. class DLL_LINKAGE Module
  31. {
  32. public:
  33. Module();
  34. virtual ~Module();
  35. virtual std::string compile(const std::string & name, const std::string & source, vstd::CLoggerBase * logger) const = 0;
  36. virtual std::shared_ptr<ContextBase> createContextFor(const Script * source, const Environment * env) const = 0;
  37. virtual void registerSpellEffect(spells::effects::Registry * registry, const Script * source) const = 0;
  38. };
  39. }
  40. #endif