ScriptedModel.h 753 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * ScriptedModel.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 "schema/base.h"
  12. namespace MMAI::BAI
  13. {
  14. class ScriptedModel : public MMAI::Schema::IModel
  15. {
  16. public:
  17. explicit ScriptedModel(const std::string & keyword);
  18. Schema::ModelType getType() override;
  19. std::string getName() override;
  20. int getVersion() override;
  21. int getAction(const MMAI::Schema::IState * s) override;
  22. Schema::Side getSide() override;
  23. double getValue(const MMAI::Schema::IState * s) override;
  24. private:
  25. const std::string keyword;
  26. void warn(const std::string & m, int retval) const;
  27. };
  28. }