2
0

CScriptingModule.h 1004 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #include <vcmi/scripting/Service.h>
  12. namespace spells
  13. {
  14. namespace effects
  15. {
  16. class Registry;
  17. }
  18. }
  19. namespace scripting
  20. {
  21. class DLL_LINKAGE ContextBase : public Context
  22. {
  23. public:
  24. ContextBase(vstd::CLoggerBase * logger_);
  25. virtual ~ContextBase();
  26. protected:
  27. vstd::CLoggerBase * logger;
  28. };
  29. class DLL_LINKAGE Module
  30. {
  31. public:
  32. Module();
  33. virtual ~Module();
  34. virtual std::string compile(const std::string & name, const std::string & source, vstd::CLoggerBase * logger) const = 0;
  35. virtual std::shared_ptr<ContextBase> createContextFor(const Script * source, const Environment * env) const = 0;
  36. virtual void registerSpellEffect(spells::effects::Registry * registry, const Script * source) const = 0;
  37. };
  38. }