main.cpp 730 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * main.cpp, 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. #include "StdInc.h"
  11. #include "../../lib/AI_Base.h"
  12. #include "StupidAI.h"
  13. #ifdef __GNUC__
  14. #define strcpy_s(a, b, c) strncpy(a, c, b)
  15. #endif
  16. static const char *g_cszAiName = "Stupid AI 0.1";
  17. extern "C" DLL_EXPORT int GetGlobalAiVersion()
  18. {
  19. return AI_INTERFACE_VER;
  20. }
  21. extern "C" DLL_EXPORT void GetAiName(char* name)
  22. {
  23. strcpy_s(name, strlen(g_cszAiName) + 1, g_cszAiName);
  24. }
  25. extern "C" DLL_EXPORT void GetNewBattleAI(std::shared_ptr<CBattleGameInterface> &out)
  26. {
  27. out = std::make_shared<CStupidAI>();
  28. }